#include <bits/stdc++.h>
using namespace std;
int a[1000010], b[100010], c[100010];
long long mn = 1e9, mx = -1e9, ans, cnt, sm;
bool ok, used[1000010];
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '4') {
      a[4]++;
    }
    if (s[i] == '7') {
      a[7]++;
    }
  }
  if (a[4] == 0 && a[7] == 0) {
    cout << -1;
    return 0;
  }
  if (a[4] >= a[7]) {
    cout << 4;
    return 0;
  }
  cout << 7;
  return 0;
}
