main=print.(\x->sum$takeWhile(<=x)$let f(p:xs)=p:f[x|x<-xs,x`rem`p/=0]in f[2..]).read=<