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