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