#include <bits/stdc++.h>
using namespace std;
int main() {
  int f = 0, s = 0, res;
  char c;
  while (cin >> c) {
    if (c == '4') f++;
    if (c == '7') s++;
  }
  if (f == 0 && s == 0)
    cout << -1;
  else if (f >= s)
    cout << 4;
  else
    cout << 7;
end:
  return 0;
}
