#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string s, t, u;
  cin >> s >> t;
  uint32_t p =
      max(*max_element(s.begin(), s.end()), *max_element(t.begin(), t.end())) -
      '0' + 1;
  uint32_t c = 0, q = 1;
  size_t l = max(s.length(), t.length()), k = 0;
  for (size_t i = 0; i < l; ++i) {
    uint32_t a = i < s.length() ? (s[s.length() - 1 - i] - '0') : 0;
    uint32_t b = i < t.length() ? (t[t.length() - 1 - i] - '0') : 0;
    c += (a + b) * q;
    q *= p;
  }
  while (c) {
    c /= p;
    ++k;
  }
  cout << k << endl;
  return 0;
}
