#include <bits/stdc++.h>
using namespace std;
int getmax(int a) {
  int MAX = 0;
  while (a > 0) {
    MAX = max(MAX, a % 10);
    a /= 10;
  }
  return MAX;
}
int cal(int x, int a, int b) {
  int c = 0;
  int d = 0;
  int tmp = 1;
  while (a > 0) {
    c += tmp * (a % 10);
    tmp *= x;
    a /= 10;
  }
  tmp = 1;
  while (b > 0) {
    c += tmp * (b % 10);
    tmp *= x;
    b /= 10;
  }
  int cnt = 0;
  c += d;
  while (c > 0) {
    cnt++;
    c /= x;
  }
  return cnt;
}
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int c = a + b;
  int MAX = max(getmax(a), getmax(b));
  int len = 0;
  for (int i = MAX + 1; i <= 10; i++) {
    len = max(len, cal(i, a, b));
  }
  printf("%d\n", len);
  return 0;
}
