#include <bits/stdc++.h>
using namespace std;
int base(int x) {
  int maxx = 0;
  while (x) maxx = max(x % 10, maxx), x /= 10;
  return maxx + 1;
}
string convert_to_base(int a, int b, int base) {
  string res = "";
  if (a < b) swap(a, b);
  string num1 = to_string(a);
  string num2 = to_string(b);
  reverse(num1.begin(), num1.end());
  reverse(num2.begin(), num2.end());
  int n = num2.length(), carry = 0;
  char ch;
  for (int i = 0, sum; i < n; i++) {
    sum = carry + (num1[i] - '0') + (num2[i] - '0');
    if (base > 10 && sum < base && sum >= 10) {
      ch = (char)(sum % base + 55);
      res += ch;
      carry = 0;
    } else {
      res += to_string(sum % base);
      carry = sum / base;
    }
  }
  for (int i = num2.length(), sum; i < num1.length(); i++) {
    sum = carry + (num1[i] - '0');
    if (base > 10 && sum < base && sum >= 10) {
      ch = (char)(sum % base + 55);
      res += ch;
      carry = 0;
    } else {
      res += to_string(sum % base);
      carry = sum / base;
    }
  }
  if (carry > 0 && carry < 10)
    res += to_string(carry);
  else if (carry >= 10) {
    ch = (char)(carry + 55);
    res += ch;
  }
  reverse(res.begin(), res.end());
  return res;
}
int digit_length(string s) { return s.size(); }
int main() {
  int a, b;
  cin >> a >> b;
  int sum = a + b;
  int maxx = digit_length(to_string(a + b));
  int min_base = max(base(a), base(b));
  int max_base = 2 * min_base - 2;
  for (int i = min_base; i <= max_base; i++) {
    maxx = max(maxx, digit_length(convert_to_base(a, b, i)));
  }
  cout << maxx << endl;
  return 0;
}
