#include <bits/stdc++.h>
using namespace std;
const bool online_judge = true;
const long long inf = 1LL << 60;
long long toInt(string s) {
  long long res;
  stringstream ss;
  ss << s;
  ss >> res;
  return res;
}
string toString(long long n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
long long f(string n, long long p) {
  long long ans = 0;
  for (long long i = 0; i < ((long long)((n).size())); i++) {
    ans = ans * p + n[i] - '0';
  }
  return ans;
}
string g(long long n, long long p) {
  if (n == 0) return "0";
  {
    if (!online_judge)
      cerr << "n"
           << " = " << (n) << " "
           << "p"
           << " = " << (p) << endl;
  };
  string ans = "";
  while (n) {
    ans.push_back(n % p);
    n /= p;
  }
  reverse((ans).begin(), (ans).end());
  return ans;
}
void run() {
  string a, b;
  cin >> a >> b;
  stringstream ss;
  ss << a << b;
  string c = ss.str();
  long long base = 0;
  for (long long i = 0; i < ((long long)((c).size())); i++) {
    base = max(base, (long long)c[i] - '0' + 1);
  }
  cout << (g(f(a, base) + f(b, base), base)).size() << endl;
}
int main(int argc, char *argv[]) {
  run();
  return 0;
}
