#include <bits/stdc++.h>
using namespace std;
int a, b;
int maxi(int v) {
  int q = -1;
  while (v) {
    int w = v % 10;
    q = max(q, w);
    v /= 10;
  }
  return q;
}
int to_normal(int v, int p) {
  int q = 0;
  while (v) {
    v /= p;
    q++;
  }
  return q;
}
int from_normal(int v, int p) {
  int q = 0;
  int w = 1;
  while (v) {
    int d = v % 10;
    q += d * w;
    w *= p;
    v /= 10;
  }
  return q;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> a >> b;
  int ans = max(maxi(a), maxi(b));
  ans++;
  int q = from_normal(a, ans) + from_normal(b, ans);
  cout << to_normal(q, ans);
  return 0;
}
