#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, b = 1;
  scanf("%d %d", &m, &n);
  int tmp;
  tmp = m;
  while (tmp > 0) {
    b = max(b, tmp % 10);
    tmp /= 10;
  }
  tmp = n;
  while (tmp > 0) {
    b = max(b, tmp % 10);
    tmp /= 10;
  }
  b++;
  int s1[12], s2[12], p1, p2;
  p1 = 0;
  while (m > 0) {
    s1[p1++] = m % 10;
    m /= 10;
  }
  p2 = 0;
  while (n > 0) {
    s2[p2++] = n % 10;
    n /= 10;
  }
  int sum, ts;
  ts = 0;
  sum = 0;
  for (int i = p1 - 1; i >= 0; i--) {
    ts *= b;
    ts += s1[i];
  }
  sum += ts;
  ts = 0;
  for (int i = p2 - 1; i >= 0; i--) {
    ts *= b;
    ts += s2[i];
  }
  sum += ts;
  int ans = 0;
  while (sum > 0) {
    sum /= b;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
