| Algorithmia IIITN 2024 - Round 1 |
|---|
| Закончено |
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.
The only line contains single integer $$$N$$$ $$$(1 \le N \le 10^{18})$$$
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.
12
7
38
15
9724
755
The possible numbers for $$$N = 12$$$ are $$$1$$$, $$$3$$$, $$$5$$$, $$$7$$$, $$$9$$$, $$$10$$$ and $$$12$$$
| Название |
|---|


