import java.util.Scanner;

class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int s;
		int[] a, b, sum;
		s = 0;
		
		a = new int[200];
		b = new int[200];
		sum = new int[200];
		
		while(scan.hasNext()){
			
			a[s] = scan.nextInt();
			b[s] = scan.nextInt();
			if(a[s] == 0 && b[s] == 0) break;
			
			sum[s] = a[s] + b[s];
			s++;
		}
		
		for(int i = 0; i < s; i++){
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		}
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int s;
		int[] a, b, sum;
		s = 0;
		
		a = new int[200];
		b = new int[200];
		sum = new int[200];
		
		while(scan.hasNext()){
			
			a[s] = scan.nextInt();
			b[s] = scan.nextInt();
			if(a[s] == 0 && b[s] == 0) break;
			
			sum[s] = a[s] + b[s];
			s++;
		}
		
		for(int i = 0; i < s; i++){
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		}
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int s;
		int[] a, b, sum;
		s = 0;
		
		a = new int[200];
		b = new int[200];
		sum = new int[200];
		
		while(scan.hasNext()){
			
			a[s] = scan.nextInt();
			b[s] = scan.nextInt();
			if(a[s] == 0 && b[s] == 0) break;
			
			sum[s] = a[s] + b[s];
			s++;
		}
		
		for(int i = 0; i < s; i++){
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int s;
		int[] a, b, sum;
		s = 0;
		
		a = new int[200];
		b = new int[200];
		sum = new int[200];
		
		while(scan.hasNext()){
			
			a[s] = scan.nextInt();
			b[s] = scan.nextInt();
			if(a[s] == 0 && b[s] == 0) break;
			
			sum[s] = a[s] + b[s];
			s++;
		}
		
		for(int i = 0; i < s; i++){
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int s; s int[] a a b b sum; sum s = 0 s 0 a = new int[200] a new int[200] 200 b = new int[200] b new int[200] 200 sum = new int[200] sum new int[200] 200 while(scan.hasNext()){
			
			a[s] = scan.nextInt();
			b[s] = scan.nextInt();
			if(a[s] == 0 && b[s] == 0) break;
			
			sum[s] = a[s] + b[s];
			s++;
		} scan.hasNext() scan.hasNext scan {
			
			a[s] = scan.nextInt();
			b[s] = scan.nextInt();
			if(a[s] == 0 && b[s] == 0) break;
			
			sum[s] = a[s] + b[s];
			s++;
		} a[s] = scan.nextInt() a[s] a s scan.nextInt() scan.nextInt scan b[s] = scan.nextInt() b[s] b s scan.nextInt() scan.nextInt scan if(a[s] == 0 && b[s] == 0) break; a[s] == 0 && b[s] == 0 a[s] == 0 a[s] a s 0 b[s] == 0 b[s] b s 0 break; sum[s] = a[s] + b[s] sum[s] sum s a[s] + b[s] a[s] a s b[s] b s s++ s for(int i = 0; i < s; i++){
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		} int i = 0; int i = 0; i 0 i < s i s i++ i++ i {
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		} {
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		} if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7); sum[i] < 10 sum[i] sum i 10 System.out.println(1) System.out.println System.out System System.out 1 if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7); sum[i] < 100 sum[i] sum i 100 System.out.println(2) System.out.println System.out System System.out 2 if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7); sum[i] < 1000 sum[i] sum i 1000 System.out.println(3) System.out.println System.out System System.out 3 if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7); sum[i] < 10000 sum[i] sum i 10000 System.out.println(4) System.out.println System.out System System.out 4 if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7); sum[i] < 100000 sum[i] sum i 100000 System.out.println(5) System.out.println System.out System System.out 5 if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7); sum[i] < 1000000 sum[i] sum i 1000000 System.out.println(6) System.out.println System.out System System.out 6 System.out.println(7) System.out.println System.out System System.out 7 String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int s;
		int[] a, b, sum;
		s = 0;
		
		a = new int[200];
		b = new int[200];
		sum = new int[200];
		
		while(scan.hasNext()){
			
			a[s] = scan.nextInt();
			b[s] = scan.nextInt();
			if(a[s] == 0 && b[s] == 0) break;
			
			sum[s] = a[s] + b[s];
			s++;
		}
		
		for(int i = 0; i < s; i++){
			if(sum[i] < 10)System.out.println(1);
			else if(sum[i] < 100)System.out.println(2);
			else if(sum[i] < 1000)System.out.println(3);
			else if(sum[i] < 10000)System.out.println(4);
			else if(sum[i] < 100000)System.out.println(5);
			else if(sum[i] < 1000000)System.out.println(6);
			else System.out.println(7);
		}
	}
}