F. Oddly Even Challenge
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

In the world of Dr. Numerus, machines communicate using special codes that follow a strict rule: the digits of a number must follow a specific pattern. Odd digits must appear at odd indices, and even digits must appear at even indices (indices are 1-based). Given a number $$$N$$$, your task is to determine how many numbers from $$$0$$$ to $$$N$$$ follow this pattern.

Input

The only line contains single integer $$$N$$$ $$$(1 \le N \le 10^{18})$$$

Output

Print a single integer — the number of valid numbers between $$$0$$$ and $$$N$$$ that have odd digits at odd indices and even digits at even indices.

Examples
Input
12
Output
7
Input
38
Output
15
Input
9724
Output
755
Note

The possible numbers for $$$N = 12$$$ are $$$1$$$, $$$3$$$, $$$5$$$, $$$7$$$, $$$9$$$, $$$10$$$ and $$$12$$$