#include <bits/stdc++.h>
using namespace std;
int g(int x) {
  int ret = 0;
  while (x) {
    ret = max(ret, x % 10);
    x /= 10;
  }
  return ret;
}
int get(int n, int b) {
  int ret = 0;
  while (n) {
    ret++;
    n /= b;
  }
  return ret;
}
int conv(int a, int bas) {
  int ret = 0, cur = 1;
  while (a) {
    int dig = a % 10;
    a /= 10;
    ret += cur * dig;
    cur *= bas;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  int ma = max(g(a), g(b));
  ++ma;
  a = conv(a, ma);
  b = conv(b, ma);
  cout << get(a + b, ma) << endl;
  return 0;
}
