#include <bits/stdc++.h>
using namespace std;
int sumNum(string S, int base) {
  int Sum = 0;
  for (int i = 0; i < S.length(); ++i) Sum = (Sum * base) + (S[i] - 48);
  return Sum;
}
int tallNum(int A, int Base) {
  int Cnt = 0;
  while (A) {
    A /= Base;
    ++Cnt;
  }
  return Cnt;
}
int main() {
  string S1, S2;
  char MX = '0';
  int H = 0, Sum = 0;
  cin >> S1 >> S2;
  for (int i = 0; i < S1.length(); ++i) {
    MX = max(MX, S1[i]);
  }
  for (int i = 0; i < S2.length(); ++i) {
    MX = max(MX, S2[i]);
  }
  H = MX - 47;
  Sum = sumNum(S1, H) + sumNum(S2, H);
  cout << tallNum(Sum, H);
  return 0;
}
