#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[120];
  char c[120];
  int i, l, j = 0, len = 0;
  scanf("%s", &s);
  l = strlen(s);
  for (i = 0; i < l; i++)
    if (s[i] == '0')
      j++;
    else
      break;
  for (i = j; i < l; i++) c[len++] = s[i];
  c[len] = '\0';
  int sev = 0, four = 0;
  for (i = 0; i < len; i++) {
    if (c[i] == '4') four++;
    if (c[i] == '7') sev++;
  }
  if (!sev && !four)
    printf("-1\n");
  else {
    if (sev > four)
      printf("7\n");
    else
      printf("4\n");
  }
  return 0;
}
