#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int r = 0;
  int lena = a.length();
  int lenb = b.length();
  int s1[1001] = {0}, s2[1001] = {0};
  for (int i = 1; i <= lena; ++i) {
    s1[i] = a[lena - i] - '0';
    r = max(r, s1[i]);
  }
  for (int i = 1; i <= lenb; ++i) {
    s2[i] = b[lenb - i] - '0';
    r = max(r, s2[i]);
  }
  r++;
  int len = max(lena, lenb);
  for (int i = 1; i <= len; ++i) {
    s1[i] += s2[i];
    s1[i + 1] += s1[i] / r;
    s1[i] %= r;
  }
  while (s1[len + 1]) {
    len++;
    s1[len + 1] += s1[len] / r;
    s1[len] %= r;
  }
  cout << len << endl;
  return 0;
}
