#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, t = 0;
  string str;
  cin >> str;
  int len = (int)str.size(), cnt4 = 0, cnt7 = 0;
  for (int i = 0; i < len; i++)
    if (str[i] == '4')
      cnt4++;
    else if (str[i] == '7')
      cnt7++;
  if (cnt4 == 0 && cnt7 == 0)
    cout << "-1";
  else if (cnt4 >= cnt7)
    cout << "4";
  else
    cout << "7";
  return 0;
}
