#include <bits/stdc++.h>
using namespace std;
long long a[1000];
char s1[1000], s2[1000];
int mp[250];
int main() {
  int i, j;
  int n, m, len, t, q, sum, p, MAX, y, x, a, b;
  scanf("%s%s", s1, s2);
  x = 1;
  a = n;
  b = m;
  for (i = 0; i < 10; i++) {
    mp['0' + i] = i;
  }
  for (i = 0; i < 6; i++) {
    mp['A' + i] = 10 + i;
  }
  for (i = 0; s1[i]; i++) {
    x = max(x, mp[s1[i]]);
  }
  for (i = 0; s2[i]; i++) {
    x = max(x, mp[s2[i]]);
  }
  x++;
  n = 0;
  m = 0;
  for (i = 0; s1[i]; i++) {
    n = n * x + mp[s1[i]];
  }
  for (i = 0; s2[i]; i++) {
    m = m * x + mp[s2[i]];
  }
  y = n + m;
  int ans = 0;
  while (y) {
    ans++;
    y /= x;
  }
  printf("%d\n", ans);
  return 0;
}
