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