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