#include <bits/stdc++.h>
using namespace std;
string fromdecimal(int x, int base) {
  string t = "";
  string t2 = "";
  while (x > 0) {
    t += '0' + x % base;
    x /= base;
  }
  for (int i = 0; i < t.length(); i++) {
    t2 += t[t.length() - i - 1];
  }
  return t2;
}
int todecimal(int x, int base) {
  int sum = 0;
  int power = 0;
  while (x > 0) {
    sum += (x % 10) * pow(base, power);
    power++;
    x /= 10;
  }
  return sum;
}
int maxim(int x, int y) {
  int ma = -1;
  while (x > 0) {
    ma = max(ma, x % 10);
    x /= 10;
  }
  while (y > 0) {
    ma = max(ma, y % 10);
    y /= 10;
  }
  return ma;
}
int main() {
  int a, b, x, y;
  cin >> a >> b;
  int m = 0;
  int maximum = maxim(a, b);
  if (maximum == 9) {
    cout << fromdecimal(a + b, 10).length();
    return 0;
  } else {
    maximum += 1;
  }
  for (int i = maximum; i <= 15; i++) {
    x = todecimal(a, i);
    y = todecimal(b, i);
    string g = fromdecimal(x + y, i);
    if (m <= g.length()) {
      m = g.length();
    }
  }
  cout << m;
  return 0;
}
