#include <bits/stdc++.h>
int getHNumber(int a) {
  int l = -1;
  int temp = -1;
  while (a) {
    temp = a % 10;
    a = a / 10;
    if (l < temp) l = temp;
  }
  return l;
}
int suminbase(int a, int b, int base) {
  int max = a;
  int min = b;
  if (max < min) {
    max = b;
    min = a;
  }
  int carry = 0, sum = 0, temp = 0, temp1 = 0, count = 0;
  while (max) {
    temp = min % 10;
    temp1 = max % 10;
    min = min / 10;
    max = max / 10;
    sum = temp + temp1 + carry;
    if (sum >= base) {
      carry = sum / base;
    } else {
      sum = 0;
      carry = 0;
    }
    count++;
  }
  if (carry) count++;
  return count;
}
int main() {
  int a, b;
  while (scanf("%d%d", &a, &b) == 2) {
    int l1 = getHNumber(a);
    int l2 = getHNumber(b);
    if (l1 < l2) l1 = l2;
    printf("%d\n", suminbase(a, b, l1 + 1));
  }
  return 0;
}
