Exact Change
시간 제한1초메모리 제한2048 MB
이진수로 주어진 a와 b에 대해 a부터 b까지 모든 금액을 정확히 지불할 수 있는 최소 2의 거듭제곱 동전 개수를 구한다.
문제
While in Binaria, you find a store where you want to buy some presents for your friends. In Binaria, the currency is bits, and the coin denominations are the set of all integer powers of . You know that you want to spend at least bits here, but no more than bits.
When you make a purchase, you must pay with exact change. You have an unlimited number of bits that you can access from your bank account, but you can choose to withdraw them in whatever denominations you find most convenient. Carrying many coins is inconvenient though, so you wish to minimize the number of coins you carry with you.
Compute the minimum number of coins you need to bring with you such that you can pay any integer amount of bits between and , inclusive.
입력
The first line of input contains a single integer , . will be written in base 2 with no leading zeros.
The second line of input contains a single integer , . will be written in base 2 with no leading zeros.
출력
Output a single integer , the minimum number of coins you need to bring.