#include<iostream>
#include<fstream>
#include<sstream>

using namespace std;

template <typename T> std::string tostr(const T& t){
    std::ostringstream os; os<<t; return os.str();
}

int main(){
    int n, m;
    string ns, ms;
    int l = 0, u = 1000000;
    int cnt = 0;
    string str;

    while(cin >> ns >> ms){
        cnt++;
        if(cnt >= 200) break;
        sscanf(ns.c_str(),"%d",&n);
        sscanf(ms.c_str(),"%d",&m);
        if(l<= n && n <= u && l <= m && m <= u){
            cout << tostr(n+m).size() << endl;
        }
    }
    return 0;
}