Problem:
Digit Number

Write a program which computes the digit number of sum of two integers a and b.

Input

There are several test cases. Each test case consists of two non-negative integers a and b which are separeted by a space in a line. The input terminates with EOF.

Constraints

0 ≤ a, b ≤ 1,000,000

The number of datasets ≤ 200

Output

Print the number of digits of a + b for each data set.

Sample Input

5 7
1 99
1000 999

Output for the Sample Input

2
3
4

Solution in JAVA (judge verdict: Wrong Answer)

import java.io.*;
import java.util.*;

class Main{
	private static int[] sum_dig(int[][] a){
		int b[] = new int[100];
		int count;
		
		for(int i = 0;i<a.length;i++){
			count = 1;
			if((a[i][0] == 0) && (a[i][1] == 0)) count = 0;
			float sum =  a[i][0]+a[i][1];
			while(sum>=10.0){
				sum = sum/10;
				count++;
			}
			b[i] = count;
		}
		return b;
	}
	private static void print_dig(int[] a){
		for(int i = 0;i<a.length;i++){
			if((a[i] == 0) && (a[i+1] == 0)) break;
			System.out.println(a[i]);
		}
	}
		public static void main(String args[]) throws IOException{
			int dig[][] = new int[100][2];
			InputStreamReader inp = new InputStreamReader(System.in);
			BufferedReader bre = new BufferedReader(inp);
			int n1,n2,i = 0;
			while(bre.ready()!=true){
				try{
				String num = bre.readLine();
				if(num == null)break;
				String[] numAry = num.split(" ");
				n1 = Integer.parseInt(numAry[0]);
				n2 = Integer.parseInt(numAry[1]);
				dig[i][0] = n1;
				dig[i][1] = n2;
				i ++;
			}
			catch(NumberFormatException e){
				break;
			}
		}
			int res[] = new int[3];
			res = sum_dig(dig);
			print_dig(res);
	}
}