#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];
    cin>>a[1]>>b[1];
    if(a[0]==a[1]&&b[0]==b[1]){
        cout<<solve(a[0],b[0])<<endl;
        return 0;
    }
    while(a[i]!=a[i+1]&&b[i]!=b[i+1]){
        cin>>a[i+2]>>b[i+2];
        i++;
    }
    for(int j=0;j<i;j++){
        cout<<solve(a[j],b[j])<<endl;
    }
    return 0;
}