#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, c1, c2;
  string s;
  cin >> s;
  for (i = 0, c1 = 0, c2 = 0; i < s.length(); i++) {
    if (s[i] == '4')
      c1++;
    else if (s[i] == '7')
      c2++;
  }
  if (c1 == 0 && c2 == 0)
    printf("-1\n");
  else {
    if (c2 > c1)
      printf("7\n");
    else
      printf("4\n");
  }
  return 0;
}
