#include <iostream>
#include <string>

using namespace std;

int main(){
  string a, b;
  while(cin >> a >> b){
    while(a.size() > b.size()) b = "0" + b;
    while(a.size() < b.size()) a = "0" + a;
    int c = 0;
    for(int i=a.size()-1;i>=0;i--){
       c = (a[i]-'0'+b[i]-'0'+c)%10;
    }
    cout << a.size() + c << endl;
  }
}