#include <bits/stdc++.h>
int fun(int a, int base) {
  int ans = 0, b;
  int i = 1;
  while (a != 0) {
    b = a % 10;
    a /= 10;
    ans += b * i;
    i *= base;
  }
  return ans;
}
int fun2(int a, int base) {
  int d = 0;
  while (a != 0) {
    d++;
    a /= base;
  }
  return d;
}
int main() {
  int c, a, b, d, max, i;
  int ans = 0;
  scanf("%d%d", &a, &b);
  c = a;
  max = 0;
  while (c != 0) {
    d = c % 10;
    c /= 10;
    if (d > max) max = d;
  }
  c = b;
  while (c != 0) {
    d = c % 10;
    c /= 10;
    if (d > max) max = d;
  }
  max++;
  a = fun(a, max);
  b = fun(b, max);
  c = a + b;
  ans = fun2(c, max);
  printf("%d\n", ans);
  return 0;
}
