//
//  main.cpp
//  Sample
//
//  Created by h3037183 on 2017/07/31.
//  Copyright ?? 2017??´ ?°????. All rights reserved.
//

#include <iostream>
using namespace std;
int main(){
    long a,b,i=0,sum=0;
    while(cin>>a>>b){
    sum=a+b;
    if(sum==1000000)i=7;
    else if(sum>99999)i=6;
    else if(sum>9999)i=5;
    else if(sum>999)i=4;
    else if(sum>99)i=3;
    else if(sum>9)i=2;
    else i=1;
    cout<<i<<endl;
        i=0;
    }
    return 0;
}