#include <bits/stdc++.h>
using namespace std;
int n, m, t = 1;
long long ans = 0;
int main() {
  while (t--) {
    string str;
    int a = 0, b = 0;
    cin >> str;
    for (int i = (int)0; i < (int)(str).size(); ++i) {
      if (str[i] == '4')
        a++;
      else if (str[i] == '7')
        b++;
    }
    if (a == 0 && b == 0)
      cout << -1;
    else
      cout << ((b > a) ? "7" : "4");
  }
  return 0;
}
