#include <bits/stdc++.h>
using namespace std;
int s = 0;
void F(int a) {
  while (a != 0) {
    s = max(a % 10, s);
    a /= 10;
  }
}
int G(int a, int b) {
  int ans = 0;
  int x = 0;
  int z = 1;
  while (a != 0 || b != 0 || x != 0) {
    int y = (a % 10) + (b % 10);
    x += y;
    ans += (x % s) * z;
    x /= s;
    z *= 10;
    a /= 10;
    b /= 10;
  }
  return ans;
}
int H(int a) {
  int t = 0;
  while (a != 0) {
    t++;
    a /= 10;
  }
  return t;
}
int main() {
  int a, b;
  cin >> a >> b;
  F(a);
  F(b);
  s++;
  int ans = G(a, b);
  cout << H(ans) << endl;
}
