#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair; const ll INF = (1LL << 61); ll mod = (ll)1e9 + 7; signed main() { ll N, M, P; cin >> N >> M >> P; vectorA(N); for (int i = 0; i < N; i++)cin >> A[i]; sort(A.rbegin(), A.rend()); for (int i = 0; i < N; i++) { if (A[i] > M) { cout << 1 << endl; return 0; } if (A[i] % P != 0) { ll x = 1; ll ans = 0; while (true) { if (x > M)break; ans++; x *= A[i]; } cout << ans << endl; return 0; } } cout << -1 << endl; }