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