#include <bits/stdc++.h>
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int c = a, t, m = 0;
  while (c != 0) {
    t = c % 10;
    c /= 10;
    if (t > m) m = t;
  }
  c = b;
  while (c != 0) {
    t = c % 10;
    c /= 10;
    if (t > m) m = t;
  }
  m++;
  int a10 = 0, b10 = 0, h = 1;
  c = a;
  while (c != 0) {
    a10 += (c % 10) * h;
    c /= 10;
    h *= m;
  }
  c = b;
  h = 1;
  while (c != 0) {
    b10 += (c % 10) * h;
    c /= 10;
    h *= m;
  }
  int r10 = a10 + b10;
  int r = 0;
  h = 1;
  while (r10 != 0) {
    r += (r10 % m) * h;
    r10 /= m;
    h *= 10;
  }
  int ans = 0;
  while (r != 0) {
    ans++;
    r /= 10;
  }
  printf("%d", ans);
  return 0;
}
