#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100100;
const int INF = 0x7f7f7f7f;
const double eps = 1e-8;
const double pi = 3.1415926535897932384626433832795;
char res[1000];
char idx[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
inline int getValue(char ch) {
  if (ch >= '0' && ch <= '9')
    return ch - '0';
  else if (ch >= 'A' && ch <= 'Z')
    return ch - 'A' + 10;
  return ch - 'a' + 36;
}
void convert(int from, int to, char *s) {
  int ith = 0, p = 0;
  int len = strlen(s);
  while (p < len) {
    int tmp = 0;
    for (int i = p; i < len; i++) {
      tmp = tmp * from + getValue(s[i]);
      s[i] = idx[tmp / to];
      tmp %= to;
    }
    res[ith++] = idx[tmp];
    for (int i = p; i < len; i++)
      if (s[i] > '0')
        break;
      else
        p++;
  }
  res[ith] = '\0';
  for (int i = 0; i < ith / 2; i++) swap(res[i], res[ith - 1 - i]);
}
int main() {
  int a = 0, b = 0, t;
  int base, maxn = 0;
  char s1[10], s2[10];
  ios::sync_with_stdio(0);
  scanf("%s %s", s1, s2);
  for (int i = 0; i < (int)strlen(s1); i++) maxn = max(maxn, s1[i] - '0');
  for (int i = 0; i < (int)strlen(s2); i++) maxn = max(maxn, s2[i] - '0');
  base = maxn + 1;
  t = 1;
  for (int i = strlen(s1) - 1; i >= 0; i--) {
    a += (s1[i] - '0') * t;
    t *= base;
  }
  t = 1;
  for (int i = strlen(s2) - 1; i >= 0; i--) {
    b += (s2[i] - '0') * t;
    t *= base;
  }
  t = a + b;
  sprintf(s1, "%d", t);
  convert(10, base, s1);
  printf("%d\n", strlen(res));
  return 0;
}
