#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, a1, b1, c = 0, r = 0, p = 1, carry = 0, f = 0;
  cin >> a >> b;
  a1 = a;
  b1 = b;
  while (a1 || b1) {
    c = max(a1 % 10, max(b1 % 10, c));
    a1 /= 10;
    b1 /= 10;
  }
  c++;
  while (a || b || carry) {
    r += ((((a % 10) + (b % 10) + carry) % c) * p);
    carry = (((a % 10) + (b % 10) + carry) / c);
    p *= 10;
    a /= 10;
    b /= 10;
  }
  if (c == 1)
    cout << "0" << endl;
  else {
    while (r) {
      f++;
      r /= 10;
    }
    cout << f << endl;
  }
  return 0;
}
