#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  long long tmp = 2;
  long long x = a;
  while (x) {
    tmp = max(tmp, x % 10 + 1);
    x /= 10;
  }
  x = b;
  while (x) {
    tmp = max(tmp, x % 10 + 1);
    x /= 10;
  }
  x = 0;
  long long ans = 1;
  while (a || b) {
    x += (a % 10) * ans;
    x += (b % 10) * ans;
    a /= 10;
    b /= 10;
    ans *= tmp;
  }
  long long res = 0;
  while (x) {
    ++res;
    x /= tmp;
  }
  cout << res << endl;
  return 0;
}
