#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n = 0, m = 0;
  string s;
  cin >> s;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '7') n++;
    if (s[i] == '4') m++;
  }
  if (m == 0 && n == 0) {
    cout << -1;
    return 0;
  }
  cout << (m >= n ? 4 : 7);
}
