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