#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
long long google_itr = 1;
vector<string> vec_splitter(string s) {
  s += ',';
  vector<string> res;
  while (!s.empty()) {
    res.push_back(s.substr(0, s.find(',')));
    s = s.substr(s.find(',') + 1);
  }
  return res;
}
void debug_out(vector<string> __attribute__((unused)) args,
               __attribute__((unused)) long long idx,
               __attribute__((unused)) long long LINE_NUM) {
  cerr << "\n";
}
template <typename Head, typename... Tail>
void debug_out(vector<string> args, long long idx, long long LINE_NUM, Head H,
               Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
const long long mod = 1e9 + 7;
const long long inf = 1e18;
void virus() {
  string s;
  cin >> s;
  long long four = 0, seven = 0;
  for (auto i : s) {
    if (i == '4')
      four++;
    else if (i == '7')
      seven++;
  }
  if (!four and !seven)
    cout << -1 << "\n";
  else {
    if (four >= seven)
      cout << "4\n";
    else
      cout << "7\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    auto start = system_clock::now();
    virus();
    auto stop = system_clock::now();
    duration<long double> duration = (stop - start);
  }
  return 0;
}
