#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string str;
  cin >> str;
  long long len = str.length();
  long long cntFour = 0;
  long long cntSevn = 0;
  for (long long i = 0; i < len; i++) {
    if (str[i] == '4')
      cntFour++;
    else if (str[i] == '7')
      cntSevn++;
  }
  if (!max(cntFour, cntSevn))
    cout << -1 << "\n";
  else if (cntFour >= cntSevn)
    cout << "4"
         << "\n";
  else if (cntFour < cntSevn)
    cout << "7"
         << "\n";
  return 0;
}
