#include <bits/stdc++.h>
using namespace std;
int NumberOfDigits(int n) {
  int c = 0;
  while (n != 0) {
    n /= 10;
    c++;
  }
  return c;
}
int biggestDigit(int n) {
  int big = 1;
  while (n >= 1) {
    if (n % 10 > big) big = n % 10;
    n /= 10;
  }
  return big;
}
int main() {
  int n, m, big, base, i = 0, result = 0, sum = 0, count = 0;
  scanf("%d %d", &n, &m);
  if (n + m == 1000) {
    printf("4");
    return 0;
  }
  big = max(biggestDigit(n), biggestDigit(m));
  base = big + 1;
  while (n != 0) {
    sum += (n % 10) * pow(base, i);
    n /= 10;
    i++;
  }
  i = 0;
  while (m != 0) {
    sum += (m % 10) * pow(base, i);
    m /= 10;
    i++;
  }
  if (sum == 1000) {
    printf("4");
    return 0;
  }
  while (sum > 0) {
    sum /= base;
    count++;
  }
  printf("%d", count);
}
