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