#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  char d;
  int cnt4 = 0, cnt7 = 0, k = n - 1;
  while (k >= 0) {
    d = s[k];
    k--;
    if (d == '4') cnt4++;
    if (d == '7') cnt7++;
  }
  if (cnt4 == 0 && cnt7 == 0)
    cout << -1;
  else {
    if (cnt4 >= cnt7)
      cout << 4;
    else
      cout << 7;
  }
  return 0;
}
