#include <bits/stdc++.h>
using namespace std;
int main() {
  FILE *in = stdin;
  int c, c2;
  int ret = 0;
  int ma;
  int n1, n2;
  fscanf(in, "%d%d", &n1, &n2);
  int x1 = n1, x2 = n2;
  int t1 = n1, t2 = n2;
  for (int cnt = 2; cnt <= 16; cnt++) {
    x1 = n1 = t1;
    x2 = n2 = t2;
    ma = 1;
    int t = n1 + n2;
    while (n1) {
      ma = max(ma, n1 % 10);
      n1 /= 10;
    }
    while (n2) {
      ma = max(ma, n2 % 10);
      n2 /= 10;
    }
    ma++;
    ma = max(ma, cnt);
    n1 = 0;
    n2 = 0;
    int k = 1;
    while (x1) {
      n1 += k * (x1 % 10);
      k *= ma;
      x1 /= 10;
    }
    k = 1;
    while (x2) {
      n2 += k * (x2 % 10);
      k *= ma;
      x2 /= 10;
    }
    t = n1 + n2;
    int mi = 0;
    while (t) {
      mi++;
      t /= ma;
    }
    ret = max(ret, mi);
  }
  printf("%d\n", ret);
  return 0;
}
