#include <bits/stdc++.h>
const int INF = (int)1e9;
using namespace std;
int main() {
  int n, m, mx = 0, sum, x;
  string str = "0123456789ABCDEF", ans = "";
  cin >> n >> m;
  x = n;
  while (x) {
    mx = max(mx, x % 10);
    x /= 10;
  }
  x = m;
  while (x) {
    mx = max(mx, x % 10);
    x /= 10;
  }
  mx++;
  string ns = to_string(n);
  string ms = to_string(m);
  n = strtol(ns.c_str(), NULL, mx);
  m = strtol(ms.c_str(), NULL, mx);
  sum = n + m;
  while (sum) {
    ans = str[sum % mx] + ans;
    sum /= mx;
  }
  cout << ans.size() << endl;
  return 0;
}
