We’re preparing your current view and syncing the latest data.
You are given an integer n. Your task is to determine how many integers in the range from 1 to n (inclusive) have the digit '1' in their decimal representation at least once.
The first and only line contains a single integer n (1 ≤ n ≤ 10^9).
Print a single integer — the count of numbers from 1 to n that contain the digit '1'.
1 ≤ n ≤ 1,000,000,000
Example 1
Input
13
Output
6
Explanation
The numbers from 1 to 13 containing digit '1' are: 1, 10, 11, 12, 13.