#include <bits/stdc++.h>
using namespace std;
int mi(string s) {
  int ma = 0;
  for (int i = 0; i < s.length(); i++) {
    ma = max(s[i] - '0', ma);
  }
  return ma + 1;
}
int conv(string s, int base) {
  int ans = 0;
  int t = 1;
  for (int i = s.length() - 1; i >= 0; i--) {
    ans += (s[i] - '0') * t;
    t *= base;
  }
  return ans;
}
int Z(int x, int base) {
  int count = 0;
  while (x > 0) {
    x /= base;
    count++;
  }
  return count;
}
int main() {
  string s, r;
  cin >> s >> r;
  int p = max(mi(s), mi(r));
  int z = conv(s, p) + conv(r, p);
  int c = Z(z, p);
  cout << c;
  return 0;
}
