#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int base = 0;
  for (int i = 0; i < a.size(); i++) {
    a[i] -= '0';
    base = max(base, (int)a[i]);
  }
  for (int i = 0; i < b.size(); i++) {
    b[i] -= '0';
    base = max(base, (int)b[i]);
  }
  base++;
  int sza = a.size() - 1, szb = b.size() - 1;
  int carry = 0;
  int cnt = 0;
  while (sza >= 0 || szb >= 0) {
    int sum = carry;
    if (sza >= 0) sum += (int)a[sza];
    if (szb >= 0) sum += (int)b[szb];
    carry = sum / base;
    sza--;
    szb--;
    cnt++;
  }
  if (carry > 0) cnt++;
  cout << cnt;
  return 0;
}
