#include <bits/stdc++.h>
using namespace std;
double L, L1, l2, n, c;
double f(double l) {
  double x = (l2 / sin(l));
  return 2 * l * x;
}
double bin(double l, double h) {
  int a = 50;
  double mid;
  while (a--) {
    mid = (l + h) / 2;
    if (l > h) break;
    if (f(mid) < L1)
      l = mid;
    else if (f(mid) == L1)
      break;
    else {
      h = mid;
    }
  }
  return mid;
}
int main() {
  long long int n;
  char ch[100000];
  long long int m = n;
  scanf("%s", ch);
  long long int f4 = 0;
  long long int f7 = 0;
  for (int i = 0; ch[i] != '\0'; i++) {
    if (ch[i] == '4') f4++;
    if (ch[i] == '7') {
      f7++;
    }
  }
  if (f4 != 0 && f4 >= f7)
    printf("4\n");
  else if (f7 != 0 && f4 < f7)
    printf("7\n");
  else
    printf("-1\n");
}
