#include <bits/stdc++.h>
using namespace std;
string tostring(long long n) {
  ostringstream ss;
  ss << n;
  return ss.str();
}
long long tonumber(string str) {
  stringstream ss;
  ss << str;
  long long n;
  ss >> n;
  return n;
}
int main() {
  int mx = -2147483647, res;
  string s;
  cin >> s;
  int sv = count(s.begin(), s.end(), '7');
  if (sv > mx) {
    mx = sv;
    res = 7;
  }
  int fo = count(s.begin(), s.end(), '4');
  if (fo >= mx) {
    mx = fo;
    res = 4;
  }
  if (!fo && !sv)
    cout << -1 << endl;
  else
    cout << res << endl;
}
