Water Problems 4

Time Limit : 1 Second

Memory Limit : 256 MB

Submission: 58

Solved: 16

Description

skyjiange takes some positive integer x and wants to get number 1 from it. skyjiange repeats the following action: if x is odd, then adds 1 to it, otherwise divides x by 2. skyjiange knows that for any positive integer number the process ends in finite time.


How many actions should skyjiange perform to get number 1 from number x?

Input

each line contains a positive integer x in binary system, its length won't exceed 100000, process to the EOF.

Output

print the required number of actions.

sample input
1001001
101110
sample output
12
8
hint
source
© 2015 HUST ACMICPC TEAM. All Right Reserved.