#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int a, b, minp = 2, newa = 0, newb = 0;
  cin >> a >> b;
  vector<int> aa, bb;
  while (a > 0) {
    aa.push_back(a % 10);
    if ((a % 10) > (minp - 1)) minp = a % 10 + 1;
    a /= 10;
  }
  while (b > 0) {
    bb.push_back(b % 10);
    if ((b % 10) > (minp - 1)) minp = b % 10 + 1;
    b /= 10;
  }
  while (aa.size() < bb.size()) {
    aa.push_back(0);
  }
  while (aa.size() > bb.size()) {
    bb.push_back(0);
  }
  int res = 0;
  for (int i = 0; i < aa.size(); i++) {
    res += aa[i] + bb[i];
    res /= minp;
  }
  if (res == 0)
    cout << aa.size() << endl;
  else
    cout << aa.size() + 1 << endl;
  return 0;
}
