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