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