#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, i, a = 0, b = 0;
  string s;
  cin >> s;
  n = (int)s.length();
  for (i = 0; i < n; i++) {
    if (s[i] == '4')
      a++;
    else if (s[i] == '7')
      b++;
  }
  if (a >= b) {
    if (a != 0)
      cout << 4;
    else
      cout << -1;
  } else {
    cout << 7;
  }
}
