#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5;
const int M = 1e5 + 5;
const int OO = 1e9;
const int MOD = 1e9 + 9;
int n, base, carry;
string a, b, ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> a >> b;
  n = max(a.size(), b.size());
  a = string(n - a.size(), '0') + a;
  b = string(n - b.size(), '0') + b;
  for (int i = 0; i < n; ++i) {
    base = max({base, a[i] - '0' + 1, b[i] - '0' + 1});
  }
  for (int i = n - 1; ~i; --i) {
    int cur = carry + a[i] + b[i] - 2 * '0';
    ans += char(cur % base);
    carry = (cur >= base);
  }
  if (carry) ans += char(carry + '0');
  cout << ans.size() << '\n';
  return 0;
}
