P=[] N=int(input()) F=[0]*(N+1) for i in range(2,N+1): if F[i]: continue P.append(i) for j in range(i,N+1,i): F[j]=1 M=5 i=0 A=[] C=0 while i