/** * @FileName a.cpp * @Author kanpurin * @Created 2021.01.08 21:35:28 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n,m,p;cin >> n >> m >> p; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; while (a[i] % p == 0) { a[i] /= p; } } sort(a.rbegin(), a.rend()); int ans = 0; ll x = 1; if (a[0] == 1) { cout << -1 << endl; return 0; } while(x < m) { x *= a[0]; ans++; } cout << ans << endl; return 0; }