#include <bits/stdc++.h>
using namespace std;
int p, x, y, sum, ans;
string a, b;
int main() {
  cin >> a >> b;
  for (int i = 0; i < a.length(); i++) p = max(p, a[i] - '0' + 1);
  for (int i = 0; i < b.length(); i++) p = max(p, b[i] - '0' + 1);
  for (int i = 0; i < a.length(); i++) (x *= p) += a[i] - '0';
  for (int i = 0; i < b.length(); i++) (y *= p) += b[i] - '0';
  sum = x + y;
  while (sum) {
    ans++;
    sum /= p;
  }
  printf("%d", ans);
}
