#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const double pi = 3.14159265358979323846;
string a, b;
inline bool read() {
  if (!(cin >> a >> b)) return false;
  return true;
}
inline void solve() {
  char m = '0';
  for (int i = 0; i < int(a.size()); ++i) m = max(m, a[i]);
  for (int i = 0; i < int(b.size()); ++i) m = max(m, b[i]);
  int os = m - '0' + 1;
  vector<int> A(a.size());
  for (int i = 0; i < int(a.size()); ++i) A[i] = a[i] - '0';
  vector<int> B(b.size());
  for (int i = 0; i < int(b.size()); ++i) B[i] = b[i] - '0';
  reverse(A.begin(), A.end());
  reverse(B.begin(), B.end());
  vector<int> ans;
  int p = 0;
  for (int i = 0; i < int(max(A.size(), B.size())); ++i) {
    ans.push_back(p);
    p = 0;
    if (i < A.size()) ans[i] += A[i];
    if (i < B.size()) ans[i] += B[i];
    if (ans[i] >= os) ans[i] -= os, p = 1;
  }
  cout << ans.size() + p << endl;
}
int main() {
  while (read()) solve();
  return 0;
}
