l=int(input()) n=0 s=0 for i in range(2,l): c=0 for j in range(2,i): if i%j==0: c+=1 if c==0: s+=i if s<=l: print(i) n+=1 print(n)