#include <bits/stdc++.h>
using namespace std;
void KhanhLun() {
  int a, b;
  cin >> a >> b;
  int x = a, y = b;
  int _max = 0;
  while (a > 0) {
    int x = a % 10;
    _max = max(x, _max);
    a /= 10;
  }
  while (b > 0) {
    int x = b % 10;
    _max = max(x, _max);
    b /= 10;
  }
  int base = _max + 1;
  int n = 1, m = 1;
  while (x > 0) {
    a += x % 10 * n;
    n *= base;
    x /= 10;
  }
  while (y > 0) {
    b += y % 10 * m;
    m *= base;
    y /= 10;
  }
  int sum = a + b, count = 0;
  while (sum > 0) {
    count++;
    sum /= base;
  }
  cout << count;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    KhanhLun();
  }
  return 0;
}
