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