#include <bits/stdc++.h>
using namespace std;
string::iterator it;
vector<int>::iterator vit;
vector<vector<int> > g;
string intToStr(long i) {
  stringstream ss;
  ss << i;
  return ss.str();
}
int m[] = {4, 7, 47, 74, 44, 77, 444, 447, 477, 744, 774, 777, 474, 747};
int main() {
  string s;
  cin >> s;
  int c1 = count(s.begin(), s.end(), '4');
  int c2 = count(s.begin(), s.end(), '7');
  if (c2 > c1) {
    printf("7\n");
    return 0;
  }
  if (c1 != 0 || c2 != 0) {
    printf("4\n");
    return 0;
  }
  printf("-1\n");
  return 0;
}
