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