#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
Volume0-0009
=end

#require 'prime'
N=1000000
#N=10
f=Array.new(N,true)
# 3 -> 0, 3 -> 1
f[0] = f[1] = false
2.upto(N-1){|i|
  if f[i] then
    (i+i).step(N-1,i){|j|
          f[j] = false
    }
  end
}

while gets do
  n = $_.to_i
  m = 0
  2.upto(n){|i|
    if f[i] then
      m += 1
    end
  }
  puts m
end