#include <iostream>
using namespace std;

int main() {
	int a,b,c,d,e,f;
	cin>>f;
	for(int i=0;i<=f;i++){
	cin>>a>>b;
	c=a+b;
	d=c;
	e=1;
	while(true){
		if(d<10){
			break;
		}
		d=d/10;
		e=e+1;
	}
	cout<<e<<endl;
	}
	return 0;
}