#include <bits/stdc++.h>
using namespace std;
char inp[1000];
int main() {
  scanf("%s", inp);
  int no4 = 0, no7 = 0;
  for (int i = 0; inp[i]; ++i) {
    if (inp[i] == '4') no4++;
    if (inp[i] == '7') no7++;
  }
  if (no4 == 0 && no7 == 0)
    puts("-1");
  else {
    if (no4 >= no7)
      puts("4");
    else
      puts("7");
  }
  return 0;
}
