#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  string x = to_string(a);
  string y = to_string(b);
  int p =
      max(*max_element(x.begin(), x.end()), *max_element(y.begin(), y.end())) -
      '0' + 1;
  reverse(x.begin(), x.end());
  reverse(y.begin(), y.end());
  if (x.size() < y.size()) {
    swap(x, y);
  }
  while (y.size() < x.size()) {
    y += '0';
  }
  string ans(x.size(), '\0');
  int carry = 0;
  for (int i = 0; i < static_cast<int>(x.size()); ++i) {
    int x_i = x[i] - '0';
    int y_i = y[i] - '0';
    int z_i = x_i + y_i + carry;
    carry = z_i / p;
    ans[i] = z_i % p + '0';
  }
  if (carry) {
    ans += carry + '0';
  }
  reverse(ans.begin(), ans.end());
  cout << ans.size() << "\n";
  return 0;
}
