#include <bits/stdc++.h>
int max(char a[], char b[]) {
  int ans = 0;
  for (int i = 0; i < strlen(a); i++)
    if (a[i] - '0' > ans) ans = a[i] - '0';
  for (int i = 0; i < strlen(b); i++)
    if (b[i] - '0' > ans) ans = b[i] - '0';
  return ans;
}
int getLen(char a[], char b[], int base) {
  char *pa, *pb;
  int c = 0, ans = strlen(a);
  pa = a + strlen(a) - 1;
  pb = b + strlen(b) - 1;
  while (pb >= b) {
    c = c + *pa - '0' + *pb - '0';
    c /= base;
    pa--;
    pb--;
  }
  while (pa >= a) {
    c = c + *pa - '0';
    c /= base;
    pa--;
  }
  if (c != 0) ans++;
  return ans;
}
int main() {
  char a[5], b[5];
  int base;
  scanf("%s%s", a, b);
  base = max(a, b) + 1;
  if (strlen(a) > strlen(b))
    printf("%d", getLen(a, b, base));
  else
    printf("%d", getLen(b, a, base));
  return 0;
}
