#include <bits/stdc++.h>
using namespace std;
int f(int a, int k) {
  if (k == 0) return 1;
  return a * f(a, k - 1);
}
int main() {
  int a, b, da[100], db[100], ja = 0, jb = 0;
  cin >> a >> b;
  int ka = -1, kb = -1;
  int t = a, s = b;
  while (t != 0) {
    if (t % 10 > ka) ka = t % 10;
    da[ja] = t % 10;
    ja++;
    t /= 10;
  }
  while (s != 0) {
    if (s % 10 > kb) kb = s % 10;
    db[jb] = s % 10;
    jb++;
    s /= 10;
  }
  int k = max(ka, kb);
  k++;
  int sa = 0, sb = 0;
  for (int i = 0; i < ja; i++) {
    sa += da[i] * f(k, i);
  }
  for (int i = 0; i < jb; i++) {
    sb += db[i] * f(k, i);
  }
  int tre = sa + sb, res[100], j = 0;
  while (tre != 0) {
    res[j] = tre % k;
    tre /= k;
    j++;
  }
  cout << j;
  return 0;
}
