#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e = 0, all = 0, i = 0;
  cin >> a >> b;
  c = a;
  d = b;
  while (c) {
    if ((c % 10) > e) {
      e = c % 10;
    }
    c = c / 10;
  }
  while (d) {
    if ((d % 10) > e) {
      e = d % 10;
    }
    d = d / 10;
  }
  e = e + 1;
  while (a) {
    all = (a % 10) * pow(e, i) + all;
    a = a / 10;
    i++;
  }
  i = 0;
  a = b;
  while (a) {
    all = (a % 10) * pow(e, i) + all;
    a = a / 10;
    i++;
  }
  i = 0;
  while (all) {
    all = all / e;
    i++;
  }
  cout << i << endl;
  return 0;
}
