I,R=input,range L=10**5 P=[] C=[0]*L for i in R(2,L): if C[i]<1: P+=[i];j=i*i while j1)!=3::2])