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