#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int x4 = 0, x7 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '4')
      x4 += 1;
    else if (s[i] == '7')
      x7 += 1;
  }
  if (x4 == 0 && x7 == 0)
    cout << -1;
  else if (x4 >= x7)
    cout << 4;
  else
    cout << 7;
  return 0;
}
