#include <bits/stdc++.h>
int max(int a, int b) { return (a > b) ? a : b; }
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int base = 0, tmp = a;
  while (tmp > 0) {
    base = max(base, tmp % 10);
    tmp /= 10;
  }
  tmp = b;
  while (tmp > 0) {
    base = max(base, tmp % 10);
    tmp /= 10;
  }
  base++;
  int carry = 0, bits = 0;
  while (a > 0 || b > 0) {
    carry = ((carry + a % 10 + b % 10) >= base) ? 1 : 0;
    a /= 10;
    b /= 10;
    bits++;
  }
  if (carry > 0) bits++;
  printf("%d\n", bits);
}
