#include <iostream>

using namespace std;
 
int main(void)
{
  int input;
  while(cin >> input)
  {
  bool isPrime[input];
  // if the index 0 do not count as the prime number
  isPrime[0] = false;
  /// if the index 1 do not count as the prime number
  isPrime[1] = false;
  // if the index 2 count as the prime number
  isPrime[2] = true;
  
	for(int i = 3; i <= input; i += 2)
    		isPrime[i] = true;
  	
	for(int i = 3; i * i <= input; i += 2)
   		 for(int j = i * i; j <= n; j += i)
     		 isPrime[j] = false;
  		 for(int i = 4; i <= n; i += 2)
    		 isPrime[i] = false;
  
	int count = 0;
 	

	for(int i = 0; i <= input; i++)
    	
	if(isPrime[i])
    	{
     	 count++;
      
    	}
  	cout << count << endl;
  }
}