#include <bits/stdc++.h>
using namespace std;
int change(int x, int base) {
  int s = 0, p = 1;
  while (x) {
    s += x % 10 * p;
    x /= 10;
    p *= base;
  }
  return s;
}
int main() {
  int n, m, i, k;
  while (cin >> n >> m) {
    int mx = 0;
    for (i = n; i > 0; i /= 10) {
      int p = i % 10;
      if (p > mx) {
        mx = p;
      }
    }
    for (i = m; i > 0; i /= 10) {
      int p = i % 10;
      if (p > mx) {
        mx = p;
      }
    }
    mx++;
    int q = change(n, mx) + change(m, mx);
    while (q) {
      q /= mx;
      i++;
    }
    cout << i << endl;
  }
}
