n,m,p,*a=map(int,open(0).read().split()) a.sort(reverse=True) b=[i if i%p else i//p for i in a] b.sort(reverse=True) x=1 j=0 while x<=m: if x*a[0]>m: print(j+1) exit() if b[0]==1: print(-1) exit() x*=b[0] j+=1