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