#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long c1 = 0, c2 = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '4') {
      c1++;
    }
    if (s[i] == '7') {
      c2++;
    }
  }
  if (c1 == 0 && c2 == 0) {
    cout << -1;
  } else {
    if (c1 >= c2) {
      cout << "4";
    } else {
      cout << "7";
    }
  }
}
