while s = gets
  n = s.chop.to_i
  l = Math::sqrt(n).ceil

  prm = []
  (2..n).each { |i| prm[i] = 1 }
  (2..l).each{ |i|
    if prm[i] == 1
      (2*i).upto(n).each { |j|
        prm[j] = nil if (j % i == 0)
      }
    end
  }
  puts prm.count{ |x| x }
end