시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 842 354 315 43.994%

문제

어린이에게 여러자리 숫자의 덧셈을 가르칠 때는 오른쪽 자리부터 왼쪽으로 하나씩 계산하는 방법을 가르쳐준다. 이때, 받아올림이 발생하게 되며 아이들은 여기서 혼란에 빠진다.

받아올림이란 영어로는 carry라고 하며, 한 자리를 더했을 때, 두 자리라면, 1을 왼쪽 자리로 올려주는 것을 뜻한다.

두 수가 주어졌을 때, 이러한 받아올림이 몇 번 발생하는지 구하는 프로그램을 작성하시오.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 10자리 이내의 양의 정수 또는 0이 주어진다. 입력의 마지막 줄에는 0 0이 있다.

출력

각 테스트 케이스에 대해서, 입력으로 주어진 두 수를 더할때 나오는 받아올림의 개수를 출력한다.

예제 입력 1

123 456
555 555
123 594
0 0

예제 출력 1

0
3
1
W3sicHJvYmxlbV9pZCI6IjQzODgiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMWJcdWM1NDRcdWM2MmNcdWI5YmMiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzViNFx1YjliMFx1Yzc3NFx1YzVkMFx1YWM4YyBcdWM1ZWNcdWI3ZWNcdWM3OTBcdWI5YWMgXHVjMjJiXHVjNzkwXHVjNzU4IFx1YjM2N1x1YzE0OFx1Yzc0NCBcdWFjMDBcdWI5NzRcdWNlNjAgXHViNTRjXHViMjk0IFx1YzYyNFx1Yjk3OFx1Y2FiZCBcdWM3OTBcdWI5YWNcdWJkODBcdWQxMzAgXHVjNjdjXHVjYWJkXHVjNzNjXHViODVjIFx1ZDU1OFx1YjA5OFx1YzUyOSBcdWFjYzRcdWMwYjBcdWQ1NThcdWIyOTQgXHViYzI5XHViYzk1XHVjNzQ0IFx1YWMwMFx1Yjk3NFx1Y2NkMFx1YzkwMFx1YjJlNC4gXHVjNzc0XHViNTRjLCBcdWJjMWJcdWM1NDRcdWM2MmNc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