#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a, b;
  cin >> a >> b;
  int s = a + b, res = 0;
  int mx = 0;
  int t = a;
  while (t > 0) {
    mx = max(mx, t % 10);
    t /= 10;
  }
  t = b;
  while (t > 0) {
    mx = max(mx, t % 10);
    t /= 10;
  }
  for (int i = mx + 1; i < 110; i++) {
    string s = "";
    stringstream ss;
    ss << a;
    ss >> s;
    reverse(s.begin(), s.end());
    int p = 1, a1 = 0;
    for (int j = 0; j < s.size(); j++) {
      a1 += (s[j] - '0') * p;
      p *= i;
    }
    stringstream ss2;
    ss2 << b;
    ss2 >> s;
    reverse(s.begin(), s.end());
    p = 1;
    int b1 = 0;
    for (int j = 0; j < s.size(); j++) {
      b1 += (s[j] - '0') * p;
      p *= i;
    }
    int sss = a1 + b1;
    int c = 0;
    while (sss) {
      c++;
      sss /= i;
    }
    res = max(res, c);
  }
  cout << res << endl;
  cin >> n;
}
