#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  string s;
  cin >> s;
  n = s.size();
  int c1 = 0, c2 = 0;
  for (int i = 0; i < n; i = i + 1) {
    if (s[i] == '4')
      c1++;
    else if (s[i] == '7')
      c2++;
  }
  if (c2 > c1)
    cout << "7";
  else if (c1 > c2)
    cout << "4";
  else if (c1 != 0)
    cout << "4";
  else
    cout << "-1";
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long test;
  test = 1;
  while (test--) {
    solve();
  }
}
