#include <bits/stdc++.h>
using namespace std;
int pwr(int base, int pow) {
  if (pow == 0) return 1;
  return base * pwr(base, pow - 1);
}
int special(int from, int to, int n) {
  int ans = 0;
  for (int i = 0; n; ++i) {
    ans += (n % to) * pwr(from, i);
    n /= to;
  }
  return ans;
}
int convert(int from, int to, int n) {
  return special(10, to, special(from, 10, n));
}
string str(char c) {
  stringstream ss;
  ss << c;
  string ret;
  ss >> ret;
  return ret;
}
string str1(int c) {
  stringstream ss;
  ss << c;
  string ret;
  ss >> ret;
  return ret;
}
void fix(string& x, string& y) {
  while (x.size() < y.size()) {
    x = str('0') + x;
  }
  while (y.size() < x.size()) {
    y = str('0') + y;
  }
}
string sum(string x, string y, int base) {
  fix(x, y);
  string ans = "";
  int rem = 0;
  for (int i = (int)x.size() - 1; i >= 0; --i) {
    int s = x[i] - '0' + y[i] - '0' + rem;
    ans = str(s % base + '0') + ans;
    rem = (s / base);
  }
  if (rem) ans = str1(rem) + ans;
  return ans;
}
int mx_digit(string x) {
  int ans = 0;
  for (int i = 0; i < (int)x.size(); ++i) {
    ans = max(ans, x[i] - '0');
  }
  return ans;
}
int main() {
  string x, y;
  cin >> x >> y;
  int mx_base = max(mx_digit(x), mx_digit(y)) + 1;
  cout << sum(x, y, mx_base).size();
  return 0;
}
