#include <bits/stdc++.h>
using namespace std;
int solve(int n, int m, int base) {
  int ret = 0, ans = 0, rem = 0, p = 1;
  while (n || m || rem) {
    int t = n % 10 + m % 10 + rem;
    rem = t / base;
    ans += (t % base) * p;
    p *= 10;
    n /= 10;
    m /= 10;
    ret++;
  }
  return ret;
}
int base(int n) {
  int ans = 0;
  while (n) {
    ans = max(ans, n % 10);
    n /= 10;
  }
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  cout << solve(n, m, 1 + max(base(n), base(m))) << endl;
  return 0;
}
