p_flg = Array.new(1000000, true)
p_flg[0] = p_flg[1] = false
p = Array.new

for i in 2..1000000
  next if !p_flg[i]

  p.push(i)

  j = i + i
  while j <= 1000000
    p_flg[j] = false
    j += i
  end
end

while s = gets
  n = s.to_i
  i = 0
  ans = 0

  while i < p.size && p[i] <= n
    ans += 1
    i += 1
  end

  puts ans
end