import std.stdio,
       std.array,
       std.conv,
       std.algorithm;

void main() {
  string s;
  while((s=readln()).length != 0) {
    string[] input = split(s);
    int pos = 1;
    int carry = 0;
    int lena = to!int(input[0].length);
    int lenb = to!int(input[1].length);
    while(true) {
      int a = lena<pos ? 0 : to!int(input[0][lena-pos]-'0');
      int b = lenb<pos ? 0 : to!int(input[1][lenb-pos]-'0');
      int res = a + b + carry;
      carry = res<10 ? 0 : 1;
      if(input[0].length <= pos && input[1].length <= pos) {
        if(carry) pos++;
        break;
      }
      pos++;
    }
    writeln(pos);
  }
}