#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const double EPS = 1e-9;
int max_digit(int n) {
  int res = 0;
  while (n) {
    res = max(res, n % 10);
    n /= 10;
  }
  return res;
}
int f1(int n, int base) {
  int res = 0, p = 1;
  while (n) {
    res += n % 10 * p;
    n /= 10;
    p *= base;
  }
  return res;
}
int f2(int n, int base) {
  int cnt = 0;
  while (n) {
    ++cnt;
    n /= base;
  }
  return cnt;
}
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int d = max(max_digit(a), max_digit(b));
  int ans = 0;
  for (int i = d + 1; i <= 5000; ++i)
    ans = max(ans, f2(f1(a, i) + f1(b, i), i));
  printf("%d", ans);
  return 0;
}
