#include <bits/stdc++.h>
using namespace std;
void read() {}
template <typename T, typename... Types>
void read(T& var1, Types&... var2) {
  cin >> var1;
  read(var2...);
}
template <class A>
void read(vector<A>& v) {
  for (auto& a : v) read(a);
}
string to_string(char c) { return string(1, c); }
string to_string(const char* s) { return string(s); }
string to_string(string s) { return s; }
string to_string(bool b) { return (b ? "true" : "false"); }
template <class T>
string to_string(vector<T>& v) {
  string s = "";
  bool b = 1;
  for (auto& a : v) {
    if (!b) s += ' ';
    b = 0;
    s += to_string(a);
  }
  return s;
}
void print() { cout << "\n"; }
template <typename T, typename... Types>
void print(T& var1, Types&... var2) {
  cout << to_string(var1);
  if (sizeof...(var2)) cout << " " << endl;
  print(var2...);
}
void KMPTable(vector<int>& v, string s) {
  v.push_back(0);
  for (int i = 1; i < s.size(); i++) {
    int j = i - 1;
    while (s[v[j]] != s[i] && j != 0) {
      j = v[j - 1];
    }
    if (j == 0 && s[j] != s[i])
      v.push_back(0);
    else {
      v.push_back(v[j] + 1);
    }
  }
}
void KMPSearch(int& count, string s, string pattern) {
  vector<int> table;
  KMPTable(table, pattern);
  for (int i = 0, j = 0; i < s.size();) {
    if (s[i] == pattern[j]) {
      i++;
      j++;
    } else if (j == 0) {
      i++;
    } else {
      j = table[j - 1];
    }
    if (j == pattern.size()) {
      count++;
      j = 0;
    }
  }
}
int main() {
  int a, b;
  read(a, b);
  string d = to_string(a), e = to_string(b);
  char maxDigit = '0';
  for (auto& c : d) {
    if (c > maxDigit) maxDigit = c;
  }
  for (auto& c : e) {
    if (c > maxDigit) maxDigit = c;
  }
  int x = 0;
  int y = 0;
  for (int i = d.size() - 1; i >= 0; i--) {
    x += pow((maxDigit - '0' + 1), d.size() - 1 - i) * (d[i] - '0');
  }
  for (int i = e.size() - 1; i >= 0; i--) {
    y += pow((maxDigit - '0' + 1), e.size() - 1 - i) * (e[i] - '0');
  }
  int ans = x + y;
  int length = 1;
  while (pow(maxDigit - '0' + 1, length) - 1 < ans) {
    length++;
  }
  print(length);
}
