#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, n, m, z, c;
  string s;
  cin >> s;
  c = 0, z = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '4')
      c++;
    else if (s[i] == '7')
      z++;
  }
  if (c == z && z == 0)
    cout << -1 << endl;
  else if (c >= z)
    cout << 4 << endl;
  else
    cout << 7 << endl;
}
