#include <bits/stdc++.h>
using namespace std;
int Max;
void Find(int a) {
  while (a) {
    if (a % 10 > Max) Max = a % 10;
    a /= 10;
  }
}
int main() {
  int a, b, i, new_a, new_b;
  int Stack[1100];
  cin >> a >> b;
  Max = 0;
  Find(a);
  Find(b);
  Max++;
  i = 0;
  new_a = new_b = 0;
  i = 1;
  while (a) {
    new_a += (a % 10) * i;
    i *= Max;
    a /= 10;
  }
  i = 1;
  while (b) {
    new_b += (b % 10) * i;
    i *= Max;
    b /= 10;
  }
  a = new_a + new_b;
  i = 0;
  while (a) {
    i++;
    a /= Max;
  }
  printf("%d\n", i);
  return 0;
}
