#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  int solve(string& s, string& t) {
    int n = s.length();
    int m = t.length();
    int mx = 0;
    for (auto c : s) {
      mx = max(mx, c - '0');
    }
    for (auto c : t) {
      mx = max(mx, c - '0');
    }
    ++mx;
    int base = mx;
    reverse(s.begin(), s.end());
    reverse(t.begin(), t.end());
    int carry = 0;
    string ans;
    for (int i = 0; i < n || i < m; ++i) {
      int a = i < n ? s[i] - '0' : 0;
      int b = i < m ? t[i] - '0' : 0;
      int x = (a + b + carry) % base;
      carry = (a + b + carry) / base;
      ans += (char)('0' + x);
    }
    if (carry) {
      ans += (char)('0' + carry);
    }
    reverse(ans.begin(), ans.end());
    return ans.length();
  }
};
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Solution sol;
  string a, b;
  cin >> a >> b;
  cout << sol.solve(a, b) << '\n';
  return 0;
}
