#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, f;
  cin >> a >> b;
  f = a;
  sort(f.begin(), f.end());
  char x = f[f.length() - 1];
  f = b;
  sort(f.begin(), f.end());
  x = max(x, f[f.length() - 1]);
  int base;
  if (x <= '9' && x >= '0')
    base = (x - '0') + 1;
  else {
    base = (x - 'A') + 11;
  }
  int c = 0, d = 0;
  for (int i = a.length() - 1, j = 1; i >= 0; i--, j *= base) {
    if (a[i] <= '9' && a[i] >= '0')
      c += (a[i] - '0') * j;
    else
      c += (a[i] - 'A' + 10) * j;
  }
  for (int i = b.length() - 1, j = 1; i >= 0; i--, j *= base) {
    if (b[i] <= '9' && b[i] >= '0')
      d += (b[i] - '0') * j;
    else
      d += (b[i] - 'A' + 10) * j;
  }
  c += d;
  string ans = "";
  while (c != 0) {
    if ((c % base) <= 9)
      x = (char)(c % base) + '0';
    else
      x = (char)(c % base) - 10 + 'A';
    ans += x;
    c /= base;
  }
  cout << ans.length() << endl;
  return 0;
}
