#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long x = 0, y = 0;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '4')
      x++;
    else if (s[i] == '7')
      y++;
  }
  if (x == 0 && y == 0)
    cout << "-1";
  else if (x >= y)
    cout << "4";
  else
    cout << "7";
  return 0;
}
