#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int32_t a, b;
  std::cin >> a >> b;
  std::vector<int32_t> ax;
  while (a != 0) {
    ax.push_back(a % 10);
    a /= 10;
  }
  std::vector<int32_t> bx;
  while (b != 0) {
    bx.push_back(b % 10);
    b /= 10;
  }
  const int32_t base = std::max(*std::max_element(ax.begin(), ax.end()),
                                *std::max_element(bx.begin(), bx.end())) +
                       1;
  std::vector<int32_t> sum;
  int32_t carry = 0;
  for (size_t i = 0; i < std::max(ax.size(), bx.size()) || carry; ++i) {
    int32_t x = carry;
    if (i < ax.size()) {
      x += ax[i];
    }
    if (i < bx.size()) {
      x += bx[i];
    }
    sum.push_back(x % base);
    carry = x / base;
  }
  std::cout << sum.size() << '\n';
}
