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