#include <bits/stdc++.h>
using namespace std;
int getLPB(int a, int b) {
  int base = 0;
  while (a || b) {
    if (a)
      base = max(base, a % 10), a /= 10;
    else
      base = max(base, b % 10), b /= 10;
  }
  return ++base;
}
int main() {
  int a, b, carry, base, length = 0;
  cin >> a >> b;
  base = getLPB(a, b);
  while (a || b || carry) {
    carry = ((a % 10 + b % 10 + carry) >= base) ? 1 : 0;
    a /= 10;
    b /= 10;
    length++;
  }
  cout << length << endl;
  return 0;
}
