Infinite Pattern Matching

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

Consider the infinite binary string II formed by concatenating the binary representations of all the strictly positive integers in increasing order: I=I = "11011100...".

You are given a binary string AA. Your task is to find the smallest integer LL such that AA is a suffix of I\[1L]I\[1 \ldots L].

입력

The only line of input contains the binary string AA, 1A551 \le \left\lvert A \right\rvert \le 55.

출력

Print a single line with a single integer: the number LL.