#include <bits/stdc++.h>
using namespace std;
char maxd(string& s) {
  char r = s[0];
  for (int i = 1; i < s.size(); ++i) {
    r = max(r, s[i]);
  }
  return r;
}
int calc(string& s, int b) {
  int res = 0;
  int m = 1;
  for (int i = s.size() - 1; i >= 0; --i) {
    res += m * (s[i] - '0');
    m *= b;
  }
  return res;
}
int main() {
  string a, b;
  cin >> a >> b;
  int base = 1 + (max(maxd(a), maxd(b)) - '0');
  int res = calc(a, base) + calc(b, base);
  int cnt = 0;
  while (res) {
    ++cnt;
    res /= base;
  }
  cout << cnt << endl;
}
