#include <bits/stdc++.h>
using namespace std;
int conversor(string n, int b) {
  int r = 0;
  for (auto k : n) r = r * b + (k - '0');
  return r;
}
string reconversor(int n, int b) {
  string r = "";
  while (n) {
    r += ((n % b) + '0');
    n /= b;
  }
  reverse(r.begin(), r.end());
  return r;
}
int main() {
  string a, b;
  cin >> a >> b;
  char maxc = '0';
  for (auto k : a) maxc = max(maxc, k);
  for (auto k : b) maxc = max(maxc, k);
  int base = maxc - '0' + 1;
  int ia = conversor(a, base), ib = conversor(b, base);
  int sum = ia + ib;
  cout << reconversor(sum, base).size() << endl;
}
