Hide

Problem H
Double Palindromes

Languages en is

You are given a positive integer n and should print the number of positive integers <n which are a palindromes both in base 10 and base 2.

Input

The first and only line of input contains a positive integer n1012.

Output

Print the number of positive integers <n which are a palindromes both in base 10 and base 2.

Sample Input 1 Sample Output 1
1000000
20
Hide

Please log in to submit a solution to this problem

Log in