#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 1010;
int main() {
  ios_base::sync_with_stdio(0);
  string line;
  cin >> line;
  int seven = 0, four = 0;
  for (int i = 0; i < line.size(); i++) {
    seven += line[i] == '7';
    four += line[i] == '4';
  }
  if (four == seven && four != 0) four++;
  if (four > seven)
    cout << 4;
  else if (seven > four)
    cout << 7;
  else
    cout << "-1";
}
