#include <bits/stdc++.h>
using namespace std;
int main() {
  int res = 0, c, summ, end = 0;
  int a, b;
  cin >> a >> b;
  summ = a + b;
  while (a >= 1) {
    c = a % 10;
    a /= 10;
    if (c >= res) res = c;
  }
  while (b >= 1) {
    c = b % 10;
    b /= 10;
    if (c >= res) res = c;
  }
  res++;
  vector<int> mass;
  while (summ >= 1) {
    c = summ % 10;
    if (c >= res) summ += 10;
    end++;
    summ /= 10;
  }
  cout << end;
}
