#include<cstdio>
#include<iostream>
using namespace std;

int main(void){
    int numtable[8]={-1,9,99,999,9999,99999,999999,9999999};
    int data[200][2];
    int result=-1;
    for(int i=0;i<200;++i){
        data[i][0]=-1;
        data[i][1]=-1;
    }
    for(int i=0;i<200;++i){
        if(0 == scanf("%d %d",&data[i][0],&data[i][1]))
            break;
    }
    for(int i=0;i<200;++i){
        if(data[i][0]!=-1&&data[i][1]!=-1){
            result=data[i][0]+data[i][1];
            for(int j=1;j<8;++j){
                if(result<=numtable[j]){
                    printf("%d\n",j);
                    break;
                }
            }
        }
    }
    return 0;
}
