#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 998244353;
const long long mod2 = 1000000007;
int main() {
  string s;
  cin >> s;
  int cnt4 = 0, cnt7 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '4') cnt4++;
    if (s[i] == '7') cnt7++;
  }
  if (cnt4 == 0 && cnt7 == 0) {
    cout << -1 << endl;
    return 0;
  }
  if (cnt4 >= cnt7) {
    cout << 4 << endl;
    return 0;
  }
  cout << 7 << endl;
  return 0;
}
