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