#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[5], b[5], max = '0', c[8];
  int da, db, A = 0, B = 0, i;
  scanf("%s%s", a, b);
  for (i = 0; a[i] != '\0'; i++) {
    if (a[i] > max) max = a[i];
  }
  da = i;
  for (i = 0; b[i] != '\0'; i++) {
    if (b[i] > max) max = b[i];
  }
  db = i;
  max = max - '0' + 1;
  int st = 1;
  for (i = da - 1; i >= 0; i--) {
    A += (a[i] - '0') * st;
    st = st * max;
  }
  st = 1;
  for (i = db - 1; i >= 0; i--) {
    B += (b[i] - '0') * st;
    st = st * max;
  }
  int C = A + B;
  st = 1;
  for (i = 1; st <= C; i++) {
    st = st * max;
  }
  printf("%d", i - 1);
  return 0;
}
