#include <bits/stdc++.h>
const int maxn = 100005;
using namespace std;
int main() {
  string a, b;
  int Max = 0;
  cin >> a >> b;
  for (int i = 0; i < a.size(); i++) Max = max(Max, a[i] - '0');
  for (int i = 0; i < b.size(); i++) Max = max(Max, b[i] - '0');
  Max++;
  int l = 0, r = 0;
  for (int i = 0; i < a.size(); i++) l = l * Max + a[i] - '0';
  for (int i = 0; i < b.size(); i++) r = r * Max + b[i] - '0';
  int c = l + r;
  int cnt = 0;
  while (c) {
    c /= Max;
    cnt++;
  }
  cout << cnt << endl;
}
