#include <bits/stdc++.h>
using namespace std;
int toint(string num, int base) {
  int res = 0;
  for (int i = 0; i < num.size(); ++i) {
    res *= base;
    res += num[i] - '0';
  }
  return res;
}
int countlength(int x, int base) {
  int res = 0;
  while (x) {
    x /= base;
    res++;
  }
  if (!res) res++;
  return res;
}
int main() {
  string a, b;
  cin >> a >> b >> b;
  int m =
      max(*max_element(a.begin(), a.end()), *max_element(b.begin(), b.end())) -
      '0';
  int x = toint(a, m + 1), y = toint(b, m + 1);
  int z = x + y;
  cout << countlength(z, m + 1) << endl;
  return 0;
}
