#include <bits/stdc++.h>
using namespace std;
int main() {
  string str, str1;
  int num, num1, num2;
  while (cin >> str >> str1) {
    int maxx = 0;
    for (int i = 0; i < str1.size(); i++) {
      maxx = max(maxx, str1[i] - '0');
    }
    for (int i = 0; i < str.size(); i++) {
      maxx = max(maxx, str[i] - '0');
    }
    stringstream ss, ss1;
    ss << str;
    ss >> num;
    ss1 << str1;
    ss1 >> num1;
    int maxx1 = 0;
    for (int i = maxx + 1; i <= 16; i++) {
      int x = num;
      int y = num1;
      int l = 0, c = 0, r;
      while (x || y || c) {
        r = c;
        if (x) r += x % 10, x /= 10;
        if (y) r += y % 10, y /= 10;
        l++;
        c = r / i;
      }
      maxx1 = max(l, maxx1);
    }
    cout << maxx1 << endl;
  }
  return 0;
}
