#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
void solve() {
  long long a, b;
  cin >> a >> b;
  long long ac = a;
  long long bc = b;
  long long ma = 0;
  while (a) {
    ma = max(a % 10, ma);
    a /= 10;
  }
  long long mb = 0;
  while (b) {
    mb = max(b % 10, mb);
    b /= 10;
  }
  long long base = max(ma, mb) + 1;
  long long ans = 0;
  long long car = 0;
  while (ac or bc or car) {
    ans++;
    long long sum = ac % 10 + bc % 10 + car;
    car = sum / base;
    ac /= 10;
    bc /= 10;
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
