#include <bits/stdc++.h>
using namespace std;
void input(long &n) { scanf("%ld", &n); }
void output(long n) { printf("%ld", n); }
long mink(long x, long y) {
  if (x < y)
    return (x);
  else
    return (y);
}
char s[100000];
int main() {
  cin >> s;
  long dem1 = 0;
  long dem2 = 0;
  long i;
  for (i = 0; i < strlen(s); i++) {
    if (s[i] == '4') dem1++;
    if (s[i] == '7') dem2++;
  }
  if (dem1 == dem2 && dem1 == 0)
    cout << -1;
  else if (dem1 == dem2 && dem1 != 0)
    cout << 4;
  else if (dem1 > dem2)
    cout << 4;
  else
    cout << 7;
}
