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