#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double eps = 1e-6;
const long long _mod = 1000000007LL;
const int save[10][4] = {{0}, {0}, {6, 2, 4, 8}, {1, 3, 9, 7}, {6, 4},
                         {0}, {0}, {1, 7, 9, 3}, {6, 8, 4, 2}, {1, 9}};
int todigit(char c) { return (isdigit(c)) ? (c - 48) : c; }
int toint(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
long long tolong(string s) {
  long long r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double todouble(string s) {
  double r = 0.0;
  istringstream sin(s);
  sin >> r;
  return r;
}
bool bit_check(int k, int p) { return (bool)(k & (1 << p)); }
int bit_set(int k, int p) { return k = (k | (1 << p)); }
template <class T>
string toString(T n) {
  ostringstream ost;
  ost << n;
  ost.flush();
  return ost.str();
}
template <class T>
T Abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
template <class T>
inline T max_(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T min_(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
int di(string num, int b);
int dig(int num);
int main() {
  int a, b;
  cin >> a >> b;
  int mn = max(dig(a), dig(b));
  mn++;
  int mx = 0;
  for (int i = mn; i < 17; ++i) {
    mx = max(mx, di(toString(a + b), i));
  }
  printf("%d\n", mx);
  return 0;
}
int di(string num, int b) {
  int n = 0;
  for (int i = 0; i < num.size(); ++i) {
    n = (n * b) + (num[i] - '0');
  }
  int cnt = 0;
  while (n) {
    n = n / b;
    ++cnt;
  }
  return cnt;
}
int dig(int num) {
  int mn = 0;
  while (num) {
    mn = max(mn, num % 10);
    num = num / 10;
  }
  return mn;
}
