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