#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int n = 0, m = 0, y = 0;
  for (long long int i = (long long int)(0); i < (long long int)(s.size());
       i++) {
    if (s[i] == '4') {
      n++;
      y = 1;
    } else if (s[i] == '7') {
      m++;
      y = 1;
    }
  }
  if (y == 0) {
    cout << -1 << endl;
  } else if (n >= m && y == 1) {
    cout << '4';
  } else if (n < m && y == 1) {
    cout << '7';
  }
}
