include Math
while buf=gets
        n=buf.to_i
        count=1
        if n==2
                puts(count)
                next
        end
        3.step(n,2){|i|
                f=true
                3.step(sqrt(i),2){|j|
                        if i%j==0
                                f=false
                                break
                        end
                }
                count+=1 if f
        }
        puts count

end