#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int count_f = 0, count_s = 0;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '4') {
      count_f++;
    }
    if (s[i] == '7') {
      count_s++;
    }
  }
  if (count_f > count_s) {
    cout << 4;
  }
  if (count_f < count_s) {
    cout << 7;
  }
  if (count_f == 0 && count_s == 0) {
    cout << -1;
  }
  if (count_f == count_s && count_f != 0) {
    cout << 4;
  }
  return 0;
}
