#include <bits/stdc++.h>
int add_base(int n1, int n2, int base) {
  int c = 0;
  int sum = 0, tsum;
  int loop = 0;
  while (n1 || n2 || c) {
    tsum = (n1 % 10) + (n2 % 10) + c;
    n1 = n1 / 10;
    n2 = n2 / 10;
    c = tsum / base;
    loop++;
  }
  return loop;
}
int max_digit(int n1) {
  int n = 0;
  while (n1) {
    if ((n1 % 10) > n) n = n1 % 10;
    n1 = n1 / 10;
  }
  return n;
}
int main() {
  int n1, n2, m1, m2;
  scanf("%d", &n1);
  scanf("%d", &n2);
  m1 = max_digit(n1);
  m2 = max_digit(n2);
  printf("%d\n", add_base(n1, n2, ((m1 > m2) ? m1 : m2) + 1));
  return 0;
}
