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