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