#include <bits/stdc++.h>
using namespace std;
const int64_t N = 1e6 + 6, M = 1e9 + 7;
int64_t f[10];
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  string s;
  cin >> s;
  for (char c : s) f[c - '0']++;
  if (!f[4] && !f[7])
    cout << -1;
  else if (f[4] >= f[7])
    cout << 4;
  else
    cout << 7;
}
