#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string s;
  cin >> s;
  unordered_map<int, int> map;
  for (int i = 0; i < s.size(); i++) {
    int temp = s[i] - '0';
    map[temp]++;
  }
  if (map[4] == 0 && map[7] == 0) {
    cout << -1 << endl;
  } else if (map[4] == map[7]) {
    cout << 4 << endl;
  } else {
    if (map[4] < map[7]) {
      cout << 7 << endl;
    } else {
      cout << 4 << endl;
    }
  }
}
