#include <bits/stdc++.h>
using namespace std;
long long int lar(long long int a, long long int b) {
  return ((a >= b) ? a : b);
}
long long int les(long long int a, long long int b) {
  return ((a <= b) ? a : b);
}
int main() {
  string s;
  cin >> s;
  vector<string> v;
  long long int a = 0, b = 0;
  for (long long int i = 0; i < s.size(); i++) {
    if (s[i] == '4')
      a++;
    else if (s[i] == '7')
      b++;
  }
  if (a == 0 && b == 0) {
    cout << -1 << endl;
    return 0;
  }
  if (a >= b)
    cout << '4' << endl;
  else
    cout << '7' << endl;
  return 0;
}
