#include <bits/stdc++.h>
using namespace std;
int base(int n) {
  int mx = 0;
  while (n) {
    mx = max(n % 10, mx);
    n /= 10;
  }
  return mx;
}
int main() {
  int a, b, tmp, cnt = 0;
  scanf("%d %d", &a, &b);
  int bas = max(base(a), base(b)) + 1;
  a += b;
  while (a) {
    tmp = (a % 10) / bas;
    a /= 10;
    a += tmp;
    cnt++;
  }
  printf("%d", cnt);
  return 0;
}
