#include <bits/stdc++.h>
using namespace std;
int Max(int s) {
  int ans = 0;
  while (s) {
    int k = s % 10;
    s /= 10;
    ans = max(ans, k);
  }
  return ans + 1;
}
int cal(int s, int b) {
  int ans = 0;
  while (s) {
    s /= b;
    ans++;
  }
  return ans;
}
int cal1(int a, int b, int k) {
  int ans = 0;
  int i = 0;
  while (a) {
    int j = a % 10;
    a /= 10;
    ans += j * (int)pow(1.0 * k, i);
    i++;
  }
  i = 0;
  while (b) {
    int j = b % 10;
    b /= 10;
    ans += j * (int)pow(1.0 * k, i);
    i++;
  }
  return ans;
}
int main() {
  int a, b;
  cin >> a >> b;
  int k = max(Max(a), Max(b));
  cout << cal(cal1(a, b, k), k) << endl;
  return 0;
}
