#include <bits/stdc++.h>
using namespace std;
int poww(int base, int exp) {
  if (exp == 0) return 1;
  int sum = base;
  for (int i = 1; i < exp; i++) sum *= base;
  return sum;
}
int main() {
  int x, y, sum = 0, cnt = 0, rem, base;
  vector<int> fina;
  char mx = '0';
  string X, Y, s = "";
  cin >> x >> y;
  X = to_string(x);
  for (int i = 0; i < X.size(); i++) {
    if (X[i] > mx) mx = X[i];
  }
  Y = to_string(y);
  for (int i = 0; i < Y.size(); i++) {
    if (Y[i] > mx) mx = Y[i];
  }
  base = mx - '0' + 1;
  for (int i = Y.size() - 1; i >= 0; i--) {
    sum += (Y[i] - '0') * poww(base, cnt);
    cnt++;
  }
  cnt = 0;
  for (int i = X.size() - 1; i >= 0; i--) {
    sum += (X[i] - '0') * poww(base, cnt);
    cnt++;
  }
  while (sum != 0) {
    fina.push_back(sum % base);
    sum /= base;
  }
  cout << fina.size() << endl;
}
