#include <bits/stdc++.h>
double pi = 3.1415926535897931159979635;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long cf = 0, cs = 0, c47 = 0, c74 = 0;
  string a;
  cin >> a;
  long long s = a.size();
  for (int i = 0; i < s; i++) {
    if (a[i] == '4') {
      cf++;
      if (a[i - 1] == '7' && i > 0) c74++;
    } else if (a[i] == '7') {
      cs++;
      if (a[i - 1] == '4' && i > 0) c47++;
    }
  }
  if (cf == 0 && cs == 0)
    cout << "-1\n";
  else
    s = max(c47, max(c74, max(cf, cs)));
  if (s == cf)
    cout << "4\n";
  else if (s == cs)
    cout << "7\n";
  else if (s == c47)
    cout << "47\n";
  else if (s == c74)
    cout << "74\n";
  return 0;
}
