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