#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
const int oo = 1e6;
int getVal(char c) {
  if (c >= '0' && c <= '9') return int(c - '0');
}
char revVal(int n) {
  if (n >= 0 && n <= 9) return char(n + '0');
}
int baseNtoDec(string number, int base) {
  int len = number.size();
  int power = 1;
  int num = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (getVal(number[i]) >= base) return INT_MIN;
    num += getVal(number[i]) * power;
    power = power * base;
  }
  return num;
}
string decToBaseN(int dec, int base) {
  string res = "";
  while (dec > 0) {
    res += revVal(dec % base);
    dec /= base;
  }
  reverse(res.begin(), res.end());
  return res;
}
char find_max(string s) {
  char mx = '0';
  for (auto i : s) mx = max(mx, i);
  return mx;
}
int main() {
  string num1, num2, sum;
  cin >> num1 >> num2;
  int base = max(find_max(num1), find_max(num2)) - '0' + 1;
  sum = decToBaseN((baseNtoDec(num1, base) + baseNtoDec(num2, base)), base);
  cout << sum.size();
}
