#include <bits/stdc++.h>
using namespace std;
int doThing(string a, string b) {
  int base =
      max(*max_element(a.begin(), a.end()), *max_element(b.begin(), b.end())) -
      '0' + 1;
  string big = (a.length() > b.length()) ? a : b;
  string small = (big == a) ? b : a;
  while (small.length() < big.length()) small = '0' + small;
  bool has = false;
  for (int i = big.length() - 1; i >= 0; --i) {
    if (big[i] + small[i] - '0' - '0' + has >= base)
      has = true;
    else
      has = false;
  }
  return big.length() + has;
}
int main() {
  ios_base::sync_with_stdio(false);
  string a, b;
  cin >> a >> b;
  cout << doThing(a, b);
  return 0;
}
