#include <bits/stdc++.h>
using namespace std;
int M;
int tree[1 << 20];
void Modify(int p, int delta) {
  for (tree[p ^= M] = delta, p >>= 1; p; p >>= 1) {
    tree[p] = max(tree[p << 1], tree[(p << 1) ^ 1]);
  }
}
int Query(int s, int t) {
  int ans = -1000000000;
  for (s = s + M - 1, t = t + M + 1; s ^ t ^ 1; s >>= 1, t >>= 1) {
    if (~s & 1) ans = max(ans, tree[s ^ 1]);
    if (t & 1) ans = max(ans, tree[t ^ 1]);
  }
  return ans;
}
int main() {
  long long a = 0, b = 0;
  char s1[10], s2[10];
  scanf("%s%s", s1, s2);
  int M = 0;
  for (int i = 0; i < strlen(s1); ++i) {
    M = max(M, s1[i] - '0');
  }
  for (int i = 0; i < strlen(s2); ++i) {
    M = max(M, s2[i] - '0');
  }
  M++;
  for (int i = 0; i < strlen(s1); ++i) {
    a = a * M + s1[i] - '0';
  }
  for (int i = 0; i < strlen(s2); ++i) {
    b = b * M + s2[i] - '0';
  }
  long long res = a + b;
  int ans = 0;
  while (res) {
    ans++;
    res /= M;
  }
  printf("%d\n", ans);
  return 0;
}
