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