#include <bits/stdc++.h>
using namespace std;
long long const MAX = 2147483647, REALMAX = 9223372036854775806;
long long power(long long a, long long y) {
  long long res = 1;
  a = a % (1000000007);
  while (y > 0) {
    if (y % 2 == 1) {
      res = (res * a) % (1000000007);
    }
    y = y / 2;
    a = (a * a) % (1000000007);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string a, b;
  int p = 0;
  cin >> a >> b;
  for (int i = 0; i < a.size(); i++) {
    string s = "";
    s += a[i];
    p = max(p, stoi(s));
  }
  for (int i = 0; i < b.size(); i++) {
    string s = "";
    s += b[i];
    p = max(p, stoi(s));
  }
  string ans = "";
  int nn = 0;
  p += 1;
  while (a.size() || b.size() || nn) {
    string s = "";
    string s1 = "";
    if (!a.empty())
      s += a[a.size() - 1];
    else
      s = "0";
    if (!b.empty())
      s1 += b[b.size() - 1];
    else
      s1 = "0";
    int q = stoi(s), q1 = stoi(s1);
    if (q + q1 + nn >= p) {
      ans = (char)((q + q1 + nn - p) + '0') + ans;
      nn = 1;
    } else {
      ans = (char)((q + q1 + nn) + '0') + ans;
      nn = 0;
    }
    a = a.substr(0, a.size() - 1);
    b = b.substr(0, b.size() - 1);
  }
  cout << ans.size() << endl;
}
