#include <bits/stdc++.h>
using namespace std;
int a, b, c, ta, tb;
int main() {
  cin >> a >> b;
  ta = a, tb = b;
  int ad = 0, bd = 0;
  while (a) {
    ad = max(ad, a % 10);
    a /= 10;
  }
  while (b) {
    bd = max(bd, b % 10);
    b /= 10;
  }
  int mx = max(ad, bd);
  int base = mx + 1, ans = 0;
  a = 0, b = 0;
  int p = 1;
  while (ta) {
    a += p * (ta % 10);
    p *= base;
    ta /= 10;
  }
  p = 1;
  while (tb) {
    b += p * (tb % 10);
    p *= base;
    tb /= 10;
  }
  c = a + b;
  while (c) {
    c /= base;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
