#include<iostream>

using namespace std;

int main()
{
        int a,b,c,d=1000000,e=7;
	for(int i=1;i<=200;i++){
		cin>>a>>b;
		if(a==-1 || b==-1){//EOF?????¨???break;
			break;
		}
		c=a+b;
		if(c==0){
			cout<<"1"<<endl;
		}
		else if(c>0){
			while(1){
				if(1<=c/d){
					cout<<e<<endl;
					break;
				}
				else{
					d/=10,e--;
				}
			}
		}
		d=1000000,e=7;
	}
	
		
	return 0;
}