f ::Int->Int f n |n<2=0 |n<4=n |otherwise=if length [1|e<-[2..(n `div` 2)],n `mod` e==0]>0 then 0 else n main =do e<-getLine let x=read e::Int print $ sum(take x [f e2|e2<-[1..1000]])