#include <bits/stdc++.h>
using namespace std;
int mymax(int x) {
  int max = 0;
  while (x) {
    int s = x % 10;
    if (s > max) max = s;
    x /= 10;
  }
  return max;
}
int zh(int x, int n) {
  int s = 0, p = 1;
  while (x) {
    s += x % 10 * p;
    x /= 10;
    p *= n;
  }
  return s;
}
int main() {
  int a, b;
  cin >> a >> b;
  int n = max(mymax(a), mymax(b)) + 1;
  int num = zh(a, n) + zh(b, n);
  int j = 0;
  while (num) {
    int s = num % n;
    num /= n;
    j++;
  }
  cout << j << endl;
  return 0;
}
