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