#include <bits/stdc++.h>
int x[] = {0, -1, 0, 1, -1, 1, -1, 1};
int y[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int MOD = 1e9 + 7, N = 1e3 + 5;
const double pi = acos(-1);
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int cnt4 = 0, cnt7 = 0;
  string s;
  cin >> s;
  for (int i = 0; i < (int)(s).size(); i++) {
    if (s[i] == '4') cnt4++;
    if (s[i] == '7') cnt7++;
  }
  if (!cnt4 && !cnt7)
    cout << "-1";
  else if (cnt7 > cnt4)
    cout << "7";
  else
    cout << "4";
  return 0;
}
