#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  ios_base::sync_with_stdio();
  while (cin >> a >> b) {
    int hi = 0;
    for (int i = 0; i < a.size(); i++) {
      hi = max((a[i] - '0'), hi);
    }
    for (int i = 0; i < b.size(); i++) {
      hi = max((b[i] - '0'), hi);
    }
    hi++;
    int ans = 0, ans_a = 0, ans_b = 0;
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());
    int val = 1;
    for (int i = 0; i < a.size(); i++) {
      ans_a += ((a[i] - '0') * val);
      val = hi * val;
    }
    val = 1;
    for (int i = 0; i < b.size(); i++) {
      ans_b += ((b[i] - '0') * val);
      val = hi * val;
    }
    ans = ans_a + ans_b;
    int cnt = 0;
    while (ans != 0) {
      ans /= hi;
      cnt++;
    }
    cout << cnt << "\n";
  }
  return 0;
}
