#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int maxnum(0);
  for (size_t i = 0; i < a.size(); i++) {
    maxnum = a[i] - '0' > maxnum ? a[i] - '0' : maxnum;
  }
  for (size_t i = 0; i < b.size(); i++) {
    maxnum = b[i] - '0' > maxnum ? b[i] - '0' : maxnum;
  }
  int base = maxnum + 1;
  int aa(0), bb(0);
  int offset(1);
  for (size_t i = 0; i < a.size(); i++) {
    aa += (a[a.size() - i - 1] - '0') * offset;
    offset *= base;
  }
  offset = 1;
  for (size_t i = 0; i < b.size(); i++) {
    bb += (b[b.size() - i - 1] - '0') * offset;
    offset *= base;
  }
  int sum = aa + bb;
  offset = base;
  for (int i = 0;; i++) {
    if (sum < offset) {
      cout << i + 1 << endl;
      return 0;
    }
    offset *= base;
  }
  return 0;
}
