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