#include <bits/stdc++.h>
using namespace std;
int main() {
  {
    long long int i, j, k, y, n, x, m, a, b, ans = 0, sum = 0, cnt = 0;
    long long int c, mx = 0;
    string s, z, taj = "YES";
    cin >> s;
    map<char, long long int> mp;
    n = s.size();
    for (i = 0; i < n; i++) mp[s[i]]++;
    if (!mp['4'] and !mp['7'])
      cout << -1;
    else if (mp['4'] >= mp['7'])
      cout << 4;
    else
      cout << 7;
    printf("\n");
  }
  return 0;
}
