#include <bits/stdc++.h>
int max(int a, int b) { return a > b ? a : b; }
int weishu(int x) {
  int sun = 0;
  int s;
  while (x > 0) {
    s = x % 10;
    if (s > sun) sun = s;
    x = x / 10;
  }
  return sun;
}
int change(int x, int base) {
  int k = 0, p = 1;
  while (x) {
    k += x % 10 * p;
    x /= 10;
    p *= base;
  }
  return k;
}
int main() {
  int a, b;
  while (~scanf("%d%d", &a, &b)) {
    int base = max(weishu(a), weishu(b)) + 1;
    int sum = change(a, base) + change(b, base);
    int t = 0;
    while (sum) {
      sum = sum / base;
      t++;
    }
    printf("%d\n", t);
  }
  return 0;
}
