#include <iostream>
#include <algorithm>

#define N 1000000

using namespace std;

int main()
{
  bool primes[N];

  fill(primes+2, primes+N, true);

  // eratos
  for(int i = 2; i < N; ++i)
    if(primes[i])
      for(int j = i+i; j < N; j += i)
	primes[j] = false;

  int n, count;
  while(cin>>n){
    count = 0;
    for(int i = 2; i <= n; ++i)
      if(primes[i]) ++count;

    cout << count << endl;
  }

  return 0;
}