#include <bits/stdc++.h>
using namespace std;
int a, b, m = 0, i, r = 0, k = 0;
int main() {
  ;
  ;
  ;
  ;
  ;
  cin >> a >> b;
  i = a;
  while (i) m = max(m, i % 10 + 1), i /= 10;
  i = b;
  while (i) m = max(m, i % 10 + 1), i /= 10;
  i = 0;
  while (a || b || r)
    i *= 10, i += (a % 10 + b % 10 + r) % m, r = (a % 10 + b % 10 + r) / m,
                                             a /= 10, b /= 10, k++;
  cout << k << endl;
  return 0;
}
