#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, base = 2, carry = 0;
  vector<int> x, y;
  cin >> a >> b;
  while (a > 0) {
    if (a % 10 >= base) base = a % 10 + 1;
    x.push_back(a % 10);
    a /= 10;
  }
  while (b > 0) {
    if (b % 10 >= base) base = b % 10 + 1;
    y.push_back(b % 10);
    b /= 10;
  }
  for (size_t i = 0; i < max(x.size(), y.size()) || carry; ++i) {
    if (i == x.size()) x.push_back(0);
    x[i] += carry + (i < y.size() ? y[i] : 0);
    carry = x[i] >= base;
    if (carry) x[i] -= base;
  }
  cout << x.size();
  return 0;
}
