#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  string a, b;
  cin >> a >> b;
  a = "0" + a;
  b = "0" + b;
  while (a.size() < max(a.size(), b.size())) a = "0" + a;
  while (b.size() < max(b.size(), a.size())) b = "0" + b;
  int base = 0, car = 0;
  for (int i = 0; i < max(a.size(), b.size()); i++) {
    base = max({base, (a[i] - '0'), (b[i] - '0')});
  }
  base++;
  string c = string(max(a.size(), b.size()), '0');
  for (int i = max(a.size(), b.size()) - 1; i >= 0; i--) {
    int n1 = (a[i] - '0'), n2 = (b[i] - '0');
    int n3 = n1 + n2 + car;
    car = 0;
    if (n3 >= base) {
      n3 -= base;
      car = 1;
    }
    c[i] = char(n3 + '0');
  }
  while (c.size() > 1 and c[0] == '0') c = c.substr(1);
  cout << c.size();
  return 0;
}
