#include <iostream> 
#include <math.h> 
#include <iomanip> 
using namespace std;  
  
int main()  
{  
int input1,input2,sum,i;
cin >> input1 >> input2;
int a=input1;
int b=input2;
int c=0;
for(i=1;i<=1;i++)
{sum=input1+input2;
for(int i=1;sum!=0;i++)
{sum=sum/10;
c=c+1;}
cout << c << endl;
c=0;
}
for(int i=1;i<=1000;i++)
{cin >> input1 >> input2;
if(a==input1 && b==input2)
{break;}
sum=input1+input2;
for(i=1;sum!=0;i++)
{sum=sum/10;
c=c+1;}
cout << c << endl;
a=input1;
b=input2;
c=0;
}
} 
