#include <bits/stdc++.h>
using namespace std;
int n, i, a, j, x, k, b, c, d, e, f[8];
string s;
int main() {
  cin >> s;
  k = s.size();
  a = s.find('4', 0);
  b = s.find('7', 0);
  if (a == -1 && b == -1)
    cout << "-1";
  else {
    for (i = 0; i < k; i++) {
      if (s[i] == '4') f[4]++;
      if (s[i] == '7') f[7]++;
    }
    if (f[4] >= f[7])
      cout << 4;
    else
      cout << 7;
  }
}
