#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  if (a >= mod) a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    if (res >= mod) res %= mod;
    a = a * a;
    if (a >= mod) a %= mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int todecimal(int n, int base) {
  int ret = 0, po = 1;
  while (n) {
    ret += (n % 10) * po;
    po = po * base;
    n = n / 10;
  }
  return ret;
}
int fromdecimal(int n, int i) {
  int ret = 0;
  while (n) {
    ret++;
    n -= n % i;
    n /= i;
  }
  return ret;
}
int main() {
  int a, b;
  cin >> a >> b;
  int ta = a, tb = b;
  int mx = 1;
  while (ta) {
    mx = max(mx, ta % 10);
    ta = ta / 10;
  }
  while (tb) {
    mx = max(mx, tb % 10);
    tb = tb / 10;
  }
  int ans = 0;
  for (int i = mx + 1; i <= 16; i++) {
    ta = todecimal(a, i), tb = todecimal(b, i);
    ta = ta + tb;
    ans = max(ans, fromdecimal(ta, i));
  }
  cout << ans << '\n';
  return 0;
}
