#include <iostream>
using namespace std;
int solve(int a,int b){
    int sum=a+b,ans=0;
    while(sum>0){
        ans++;
        sum/=10;
    }
    return ans;
}
int main(void){
    int a[300]={},b[300]={},i=0;
    cin>>a[0]>>b[0];
    cout<<solve(a[0],b[0])<<endl;
    a[0]=2000000;
    while(a[i]!=a[i+1]&&b[i]!=b[i+1]){
        i++;
        cin>>a[i]>>b[i];
    }
    for(int j=1;j<i;j++){
        cout<<solve(a[j],b[j])<<endl;
    }
    return 0;
}