#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, ta, tb, tta, ttb, ml;
  scanf("%d%d", &a, &b);
  ta = a;
  int bs = -1, ans, sm;
  while (ta) {
    bs = max(bs, ta % 10);
    ta /= 10;
  }
  tb = b;
  while (tb) {
    bs = max(bs, tb % 10);
    tb /= 10;
  }
  bs += 1;
  ta = a;
  tta = 0;
  ml = 1;
  while (ta) {
    tta += ml * (ta % 10);
    ta /= 10;
    ml *= bs;
  }
  tb = b;
  ttb = 0;
  ml = 1;
  while (tb) {
    ttb += ml * (tb % 10);
    ;
    tb /= 10;
    ml *= bs;
  }
  sm = tta + ttb;
  ans = 0;
  while (sm) {
    sm = sm / bs;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
