#include <bits/stdc++.h>
int atob(int t, int a, int b) {
  int ret = 0, p = 1;
  while (t) {
    ret += t % b * p;
    p *= a;
    t /= b;
  }
  return ret;
}
int maxbit(int t) {
  int ret = t % 10;
  while (t) {
    if (ret < t % 10) ret = t % 10;
    t /= 10;
  }
  return ret;
}
int len(int t) {
  int cnt = 0;
  while (t) {
    cnt++;
    t /= 10;
  }
  return cnt;
}
int main() {
  int a, b, base, res = 0;
  scanf("%d%d", &a, &b);
  base = maxbit(a) + 1;
  if (base < maxbit(b) + 1) base = maxbit(b) + 1;
  for (; base <= 10; ++base) {
    int ta = atob(a, base, 10), tb = atob(b, base, 10),
        t = atob(ta + tb, 10, base);
    if (res < len(t)) res = len(t);
  }
  printf("%d", res);
  return 0;
}
