#include <iostream>
using namespace std ;

int main()
{
	bool num[1000000] ;
	for( int i = 0 ; i < 1000000 ; i ++ )
	{
		num[i] = false ;
	}

	int count = 0 ;
	int get ;
	while( cin >> get )
	{
		for( int i = 2 ; i <= get ; i ++ )
		{
			if( num[i] == false )
			{
				for( int j = 1 ; j < (get/i) ; j ++ )
				{
					num[i+(j*i)] = true ;
				}

				count ++ ;
			}
		}
		cout << count << endl ;
		count =  0 ;

		for( int i = 0 ; i < get ; i ++ )
		{
			num[i] = false ;
		}
	}

	return 0 ;
}