#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int A, B;
  cin >> A >> B;
  int S = max(A % 10, B % 10), res = 0;
  for (int i = A; i; i /= 10) S = max(S, i % 10);
  for (int i = B; i; i /= 10) S = max(S, i % 10);
  S++;
  for (int i = (S); i < (100000); ++i) {
    vector<int> T;
    int c = 0, x = A, y = B;
    for (; x | y; x /= 10, y /= 10)
      T.push_back(x % 10 + y % 10 + c), c = T.back() / i, T.back() /= i;
    res = max(res, c + (int)T.size());
  }
  printf("%d\n", res);
  return 0;
}
