#include <bits/stdc++.h>
using namespace std;
string toString(int x) {
  string str = "";
  while (x) {
    str += char(x % 10 + '0');
    x /= 10;
  }
  reverse(str.begin(), str.end());
  return str;
}
int getLen(int a, int b, int base) {
  string sa = toString(a);
  string sb = toString(b);
  int lena = sa.length();
  int lenb = sb.length();
  if (lena != lenb) {
    if (lena > lenb) {
      string temp = "";
      for (int i = 0; i < abs(lena - lenb); i++) temp += "0";
      temp += sb;
      sb = temp;
      lenb = sb.length();
    } else {
      string temp = "";
      for (int i = 0; i < abs(lenb - lena); i++) temp += "0";
      temp += sa;
      sa = temp;
      lena = sa.length();
    }
  }
  int carry = 0;
  int cnt = 0;
  for (int i = lena - 1; i >= 0; i--) {
    int sum = sa[i] - '0';
    sum += (sb[i] - '0');
    sum += carry;
    carry = 0;
    cnt++;
    if (sum >= base) {
      sum -= base;
      carry = 1;
    } else {
      carry = 0;
    }
  }
  if (carry) cnt++;
  return cnt;
}
int main() {
  int a, b, base = 1;
  cin >> a >> b;
  int x;
  x = a;
  while (x) {
    base = max(base, x % 10);
    x /= 10;
  }
  x = b;
  while (x) {
    base = max(base, x % 10);
    x /= 10;
  }
  int maxi = 0;
  for (int i = 16; i > base; i--) {
    maxi = max(maxi, getLen(a, b, i));
  }
  cout << maxi << endl;
  return 0;
}
