#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30, N = 1002;
int ax[] = {0, 1, -1, 0, 0};
int ay[] = {0, 0, 0, -1, 1};
int main() {
  int a, b, x, mx = -1;
  vector<int> v1, v2;
  cin >> a >> b;
  if (a < b) swap(a, b);
  x = a;
  while (x > 0) {
    v1.push_back(x % 10);
    mx = max(x % 10, mx);
    x /= 10;
  }
  x = b;
  while (x > 0) {
    v2.push_back(x % 10);
    mx = max(x % 10, mx);
    x /= 10;
  }
  v2.resize(v1.size());
  mx++;
  for (int i = 0; i < v1.size(); i++) {
    v1[i] += v2[i];
    if (v1[i] >= mx)
      if (i == v1.size() - 1) {
        v1.push_back(v1[i] / mx);
        v2.push_back(0);
        v1[i] %= mx;
      } else {
        v1[i + 1] += v1[i] / mx;
        v1[i] %= mx;
      }
  }
  cout << v1.size();
  return 0;
}
