#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  long long int mx = 0;
  for (long long int i = 0; i < a.size(); i++) {
    long long int g = (a[i] - '0');
    mx = max(mx, g);
  }
  for (long long int i = 0; i < b.size(); i++) {
    long long int g = (b[i] - '0');
    mx = max(mx, g);
  }
  mx++;
  string h = "";
  long long int c = 0, s = 0;
  for (long long int i = 0; i < 20; i++) {
    if (a.size() < i) a = "0" + a;
    if (b.size() < i) b = "0" + b;
  }
  for (long long int i = 18; i >= 0; i--) {
    long long int q = (a[i] - '0'), w = (b[i] - '0');
    s = (q + w + c) % mx;
    char ch = ('0' + s);
    h = ch + h;
    c = (q + w + c) / mx;
  }
  long long int k = 0;
  while (h[k] == '0') k++;
  cout << 19 - k << endl;
}
