CF1204A.BowWow and the Timetable

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

BowWow and the Timetable

In the city of Saint Petersburg, a day lasts for 21002^{100} minutes. From the main station of Saint Petersburg, a train departs after 11 minute, 44 minutes, 1616 minutes, and so on; in other words, the train departs at time 4k4^k for each integer k0k \geq 0. Team BowWow has arrived at the station at the time ss and it is trying to count how many trains have they missed; in other words, the number of trains that have departed strictly before time ss. For example if s=20s = 20, then they missed trains which have departed at 11, 44 and 1616. As you are the only one who knows the time, help them!

Note that the number ss will be given you in a binary representation without leading zeroes.

Input

The first line contains a single binary number ss (0s<21000 \leq s \lt 2^{100}) without leading zeroes.

Output

Output a single number — the number of trains which have departed strictly before the time ss.

Note

In the first example 1000000002=25610100000000_2 = 256_{10}, missed trains have departed at 11, 44, 1616 and 6464.

In the second example 1012=510101_2 = 5_{10}, trains have departed at 11 and 44.

The third example is explained in the statements.

Samples

100000000
4
101
2
10100
3

在线编程 IDE

建议全屏模式获得最佳体验