#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  string s;
  cin >> s;
  for (int i = 0; i < s[i]; i++) {
    m[s[i] - '0']++;
  }
  if (!m[4] and !m[7]) {
    cout << -1 << endl;
  } else if (m[4] >= m[7]) {
    cout << 4 << endl;
  } else if (m[4] < m[7]) {
    cout << 7 << endl;
  }
  return 0;
}
