#include <bits/stdc++.h>
using namespace std;
int main() {
  string input, temp;
  cin >> input;
  unordered_map<char, int> mp;
  for (int i = 0; i < input.length(); i++) {
    if (input[i] == '4' || input[i] == '7') mp[input[i]]++;
  }
  int mx = 0;
  for (auto it : mp) {
    mx = max(it.second, mx);
  }
  if (mx == 0) {
    cout << "-1" << endl;
  } else if (mp.find('4') != mp.end() && mx == mp['4'])
    cout << '4' << endl;
  else
    cout << '7' << endl;
}
