#include<iostream>
using namespace std;


int main(){

int i,d,n1,n2,sum,c;

int a,b;

while(cin >> n1 >> n2){
    if(n1 == -1 or n2 == -1)  break;
   while(n1 < 0 or n1 > 1000000 or n2 < 0 or n2 > 1000000){
      cin >> n1 >> n2;
   }
   if(n1 >= 0 and n1 <= 1000000 and n2 >= 0 and n2 <= 1000000){
       a=n1;
       b=n2;
       c=0;
       sum=a+b;
       while((sum/10)!=0){
           c++;
           sum=sum/10;
        }
       cout << c+1 << "\n";
   }
}
return 0;
}