#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long sum4 = count(begin(s), end(s), '4');
  long long sum7 = count(begin(s), end(s), '7');
  if (sum4 == 0 && sum7 == 0) {
    cout << -1 << endl;
    exit(0);
  }
  if (sum4 >= sum7) {
    cout << 4 << endl;
  } else {
    cout << 7 << endl;
  }
  return 0;
}
