#include <bits/stdc++.h>
static int minimal_digit(int n) {
  int d;
  for (d = 0; n > 0; n /= 10) d = std::max(d, n % 10);
  return d;
}
static int minimal_base(const int a, const int b) {
  return std::max(minimal_digit(a), minimal_digit(b)) + 1;
}
static int number_to_base(int n, const int b) {
  int r, m;
  for (r = 0, m = 1; n > 0; m *= b, n /= 10) r += (n % 10) * m;
  return r;
}
static int length_in_base(int n, const int b) {
  int l;
  for (l = 1; n >= b; n /= b) l++;
  return l;
}
int main(int argc, char *argv[]) {
  int a, b;
  if (scanf("%d %d", &a, &b) != 2 || a < 1 || 1000 < a || b < 1 || 1000 < b) {
    fprintf(stderr, "scanf: Header IO error.\n");
    exit(EXIT_FAILURE);
  }
  const int base = minimal_base(a, b);
  const int sum = number_to_base(a, base) + number_to_base(b, base);
  const int length = length_in_base(sum, base);
  printf("%d\n", length);
  return EXIT_SUCCESS;
}
