#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int l = 0, aa = a, bb = b;
  while (aa > 0) {
    if (aa % 10 > l) l = aa % 10;
    aa /= 10;
  }
  while (bb > 0) {
    if (bb % 10 > l) l = bb % 10;
    bb /= 10;
  }
  l++;
  int d = 0, i = 0;
  if (b > a) a ^= b ^= a ^= b;
  while (b > 0) {
    d = (a % 10 + b % 10 + d) / l;
    i++;
    a /= 10;
    b /= 10;
  }
  while (a > 0) {
    d = (d + a % 10) / l;
    i++;
    a /= 10;
  }
  if (d) i++;
  printf("%d", i);
}
