#include <bits/stdc++.h>
using namespace std;
int i;
int main() {
  string s;
  cin >> s;
  int k;
  i = 0;
  while (s[i] == '0') {
    i++;
  }
  int f = 0, v = 0;
  bool b = false;
  while (i != s.size()) {
    if (s[i] == '4')
      f++;
    else if (s[i] == '7')
      v++;
    i++;
  }
  if (b)
    cout << -1;
  else {
    if (f != 0 && f == v)
      cout << 4;
    else if (f > v)
      cout << 4;
    else if (v > f)
      cout << 7;
    else
      cout << -1;
  }
}
