#include <bits/stdc++.h>
using namespace std;
int get_max(int n) {
  int ret = 0;
  while (n) {
    ret = max(ret, n % 10);
    n /= 10;
  }
  return ret;
}
long long convert_base(long long number, int base1, int base2) {
  long long cur = 0, tmp = number, mul = 1;
  while (tmp) {
    cur += (tmp % 10) * mul;
    mul *= base1;
    tmp /= 10;
  }
  string ret = "";
  while (cur) {
    ret += (cur % base2) + '0';
    cur /= base2;
  }
  reverse(ret.begin(), ret.end());
  return stoll(ret);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int a, b;
  cin >> a >> b;
  int base = max(get_max(a), get_max(b)) + 1;
  long long v1 = convert_base(a, base, 10), v2 = convert_base(b, base, 10);
  v1 += v2;
  v1 = convert_base(v1, 10, base);
  int ans = 0;
  while (v1) ans++, v1 /= 10;
  cout << ans;
  return 0;
}
