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