#include <bits/stdc++.h>
using namespace std;
const int Max = 100;
char s[Max];
int main() {
  int n, four, seven;
  while (scanf("%s", s) != EOF) {
    four = seven = 0;
    n = strlen(s);
    for (int i = 0; i < n; i++) {
      if (s[i] == '4') four++;
      if (s[i] == '7') seven++;
    }
    if (four == 0 && seven == 0)
      printf("-1\n");
    else {
      if (four >= seven)
        printf("4\n");
      else
        printf("7\n");
    }
  }
  return 0;
}
