Infinite Pattern Matching
시간 제한1초메모리 제한256 MB
1, 2, 3, ...을 이진수로 이어 붙인 무한 문자열의 길이 L인 접두사가 A로 끝나는 가장 작은 L을 구한다.
문제
Consider the infinite binary string formed by concatenating the binary representations of all the strictly positive integers in increasing order: "11011100...".
You are given a binary string . Your task is to find the smallest integer such that is a suffix of .
입력
The only line of input contains the binary string , .
출력
Print a single line with a single integer: the number .