#include <bits/stdc++.h>
using namespace std;
string a, b;
int c[10], d[10];
int main() {
  cin >> a >> b;
  int base = 0;
  for (int i = 0; i < a.size(); i++) base = max(base, a[i] - 47);
  for (int i = 0; i < b.size(); i++) base = max(base, b[i] - 47);
  memset(c, 0, sizeof(c));
  memset(d, 0, sizeof(d));
  for (int i = 1; i <= a.size(); i++) c[i] = a[a.size() - i] - 48;
  for (int i = 1; i <= b.size(); i++) d[i] = b[b.size() - i] - 48;
  int L = max(a.size(), b.size()), ans = 0;
  for (; base <= 1001; base++) {
    int g = 0;
    for (int i = 1; i <= L; i++) g = (c[i] + d[i] + g) / base;
    int cur = L + (g != 0);
    ans = max(ans, cur);
  }
  cout << ans << endl;
  return 0;
}
