#include <bits/stdc++.h>
using namespace std;
int get_max(int x) {
  int m = 0;
  while (x > 0) {
    m = max(m, x % 10);
    x /= 10;
  }
  return m;
}
int to_dec(int n, int base) {
  int out = 0, d = 1;
  while (n > 0) {
    out += (n % 10) * d;
    n /= 10;
    d *= base;
  }
  return out;
}
int main() {
  float a, b, base;
  cin >> a >> b;
  base = max((int)base, get_max(a));
  base = max((int)base, get_max(b));
  base++;
  a = to_dec(a, base);
  b = to_dec(b, base);
  a += b;
  if (a < base)
    cout << 1;
  else
    cout << (int)(log(a) / log(base)) + 1;
  return 0;
}
