#include <bits/stdc++.h>
int main() {
  int a, b, c, i, j, k;
  char s[101];
  while (gets(s)) {
    a = strlen(s);
    b = c = 0;
    for (i = 0; i < a; i++) {
      if (s[i] == '4')
        b++;
      else if (s[i] == '7')
        c++;
    }
    if (b == 0 && c == 0)
      printf("-1\n");
    else if (b >= c)
      printf("4\n");
    else
      printf("7\n");
  }
  return 0;
}
