#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  while (cin >> a >> b) {
    int min = 0;
    int temp = a;
    while (temp) {
      if (min < temp % 10) min = temp % 10;
      temp /= 10;
    }
    temp = b;
    while (temp) {
      if (min < temp % 10) min = temp % 10;
      temp /= 10;
    }
    min++;
    int i = 0;
    int c = 0;
    temp = a + b;
    while (a || b || c) {
      int sum = a % 10 + b % 10 + c;
      c = sum / min;
      a /= 10;
      b /= 10;
      i++;
    }
    cout << i << endl;
  }
  return 0;
}
