#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int p = 0;
  int aa = a;
  while (aa > 0) {
    p = max(p, aa % 10);
    aa = aa / 10;
  }
  int bb = b;
  while (bb > 0) {
    p = max(p, bb % 10);
    bb = bb / 10;
  }
  p++;
  int carry = 0;
  int num = 0;
  while (a > 0 or b > 0 or carry > 0) {
    carry = ((a % 10) + (b % 10) + carry) / p;
    a = a / 10;
    b = b / 10;
    num++;
  }
  cout << num << endl;
}
