#include<iostream>
using namespace std;

int main(){
	int sum,j;
	int i=0;
	int N;
	
	cout << "How many date sets (N<=200) N=";
	cin >> N;
	int a[N], b[N], dig[N];
	
	while(i<N){
		cout << "please input `a b' : ";
		cin >> a[i] >> b[i];
		dig[i]=1;
		if(0<=a[i] && a[i]<=1000000 && 0<=b[i] && b[i]<=1000000){
			sum = a[i]+b[i];
			while(sum/10 != 0){
				sum = sum/10;
				dig[i] += 1;
			}
			i++;
		}
		else{
			cout << "error!\n";
		}
	}
	
	for(j=0; j<i; j++){
		cout << dig[j] << "\n";
	}
}