#include <iostream>
using namespace std;

int main(void) {
    int a, b;
    int sum;
    
    while(true) {
        cin >> a;
        cin >> b;
        if(a < 0 || b < 0) {
            break;
        }
        sum = a + b;
        
        int check = 1;
        for(int i = 0; i < 7; ++i) {
            if(sum < check - 1) {
                cout << i << endl;
                break;
            }
            check *= 10;
        }
    }
}

