#include <bits/stdc++.h>
using namespace std;
char c[100];
int can[256];
int main() {
  gets(c);
  for (int i = 0; c[i]; ++i) {
    can[c[i]]++;
  }
  if (!can['4'] && !can['7']) {
    printf("-1\n");
  } else {
    printf("%c\n", can['4'] >= can['7'] ? '4' : '7');
  }
  return 0;
}
