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