#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int x = a, y = b;
  int mx = 0;
  while (x > 0) {
    int now = x % 10;
    mx = max(now, mx);
    x /= 10;
  }
  while (y > 0) {
    int now = y % 10;
    mx = max(now, mx);
    y /= 10;
  }
  mx++;
  int an = 0, bn = 0;
  int i = 0;
  while (a > 0) {
    an += (a % 10) * pow(mx, i);
    i++;
    a /= 10;
  }
  i = 0;
  while (b > 0) {
    bn += (b % 10) * pow(mx, i);
    i++;
    b /= 10;
  }
  i = 0;
  while (pow(mx, i) <= an + bn) {
    i++;
  }
  cout << i << '\n';
  ;
}
