#include <bits/stdc++.h>
using namespace std;
int getd(int x) {
  int ret = 0;
  while (x) {
    ((ret) = max((ret), (x % 10)));
    x /= 10;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int x, y;
  cin >> x >> y;
  int d = max(getd(x), getd(y)) + 1;
  int xx = 0, yy = 0;
  int an = 1;
  while (x or y) {
    xx += (x % 10) * an;
    yy += (y % 10) * an;
    x /= 10;
    y /= 10;
    an *= d;
  }
  int sum = xx + yy;
  int cnt = 0;
  while (sum) {
    cnt++;
    sum /= d;
  }
  cout << cnt << endl;
  return 0;
}
