Dial
The dial shows a sequence of numbers in binary format. Dividing lines can be placed either between the numbers or between the digits of a single number, splitting it into two or more numbers. For each sector, you can calculate the sum of the numbers within it.
Each number in the sequence is non-zero and begins with a one. The binary representation of each number contains no more than 25 digits. The total number of digits on the dial does not exceed 100.
The dial can be divided into sectors. The figure illustrates a familiar dial with numbers from 1 to 12 (in a slightly unconventional form). It is divided into 4 sectors. The sums in these sectors are 1, 15, 18, and 36.
Write a program named DIAL that calculates the number of different ways to divide the dial into sectors so that the sum of numbers in all sectors is equal, given the sequence.
Input
The sequence of numbers is provided in a single line of the input file, with numbers separated by spaces.
Output
The output file should contain a single natural number, representing the number of ways to divide the dial into sectors as required.