시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB100746674.157%

문제

A binary number can be encoded into decimal digits by the following counting method.

Binary number Counting Decimal digits
000 3x0 30
0111 1x0 3x1 1031
111000001 3x1 5x0 1x1 315011
1010 1x1 1x0 1x1 1x0 11101110

입력

The input includes lines of a character string representing a binary number. The length of a binary number in each line is between 1 and 100 inclusive. The line containing only zero (0) indicates the end of the input. The last line must not be encoded into decimal digits. The input may contain up to 1,000 lines.

출력

Print out in each line the decimal digits corresponding to the binary number. There is no space between digits.

예제 입력 1

111100000011
000
01010101
11
0

예제 출력 1

416021
30
1011101110111011
21