During long winter evenings, Lady entertains herself with numbers. She takes the numbers from to , crosses out any number that includes the digit , and counts how many numbers remain. Since can be quite large and Lady is feeling weary, she seeks your assistance. Your task is to write a program that calculates the number of natural numbers from to that do not have the digit in their representation.
The input consists of a single line containing the integer (1 \leq n \leq 10^{18}).
The output should be a single number representing the count of natural numbers from to that do not contain the digit in their notation.
Example 1