#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int ans, nn;
char x[100010];
int change(int t) {
  int rtn = 0, bit = 1;
  while (t) {
    rtn += (t % 10) * bit;
    bit *= ans;
    t /= 10;
  }
  return rtn;
}
int main() {
  scanf("%d%d", &a, &b);
  int aa = a, bb = b;
  while (aa) {
    ans = max(ans, aa % 10);
    aa /= 10;
  }
  while (bb) {
    ans = max(ans, bb % 10);
    bb /= 10;
  }
  ans += 1;
  a = change(a);
  b = change(b);
  a += b;
  while (a) {
    x[nn++] = a % ans + '0';
    a /= ans;
  }
  printf("%d", nn);
  return 0;
}
