#include <bits/stdc++.h>
using namespace std;
int f(int x, int base) {
  int sum = 0, r, pos = 1;
  while (x) {
    r = x % 10;
    sum += pos * r;
    pos *= base;
    x /= 10;
  }
  return sum;
}
int main() {
  int a, b, x, y, z, max = 0;
  cin >> a >> b;
  x = a;
  y = b;
  while (x) {
    z = x % 10;
    if (z > max) {
      max = z;
    }
    x /= 10;
  }
  while (y) {
    z = y % 10;
    if (z > max) {
      max = z;
    }
    y /= 10;
  }
  max++;
  a = f(a, max);
  b = f(b, max);
  int tot = a + b, c = 0;
  while (tot) {
    tot /= max;
    c++;
  }
  cout << c << endl;
  return 0;
}
