#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long a, b, ans, base, i, sl, bb, ll;
  string sa, sb, ss;
  char ca, cb;
  cin >> sa >> sb;
  ca = *max_element(sa.begin(), sa.end());
  cb = *max_element(sb.begin(), sb.end());
  base = max(ca - '0', cb - '0') + 1;
  ans = 0;
  for (bb = 1, i = sa.length() - 1; i >= 0; i--, bb *= base)
    ans += (sa[i] - '0') * bb;
  for (bb = 1, i = sb.length() - 1; i >= 0; i--, bb *= base)
    ans += (sb[i] - '0') * bb;
  ll = 0;
  do {
    ll++;
    ans /= base;
  } while (ans > 0);
  cout << ll << "\n";
  return 0;
}
