#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int f = 0, sv = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '4')
      f++;
    else if (s[i] == '7')
      sv++;
  if (f >= sv && f > 0)
    cout << 4 << endl;
  else if (sv > 0)
    cout << 7 << endl;
  else
    cout << -1 << endl;
  return 0;
}
