#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, d = 0, g = 0, nilll = 0;
  string str;
  cin >> str;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '4') {
      d++;
    } else if (str[i] == '7') {
      g++;
    } else {
      nilll++;
    }
  }
  if (nilll == str.size()) {
    cout << "-1" << endl;
  } else if (d >= g) {
    cout << "4" << endl;
  } else {
    cout << "7" << endl;
  }
  return 0;
}
