#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

int gcd( int, int );

bool isPrime( int n )
{
	for ( int i = 2; i <= sqrt( n ); i++ )
	{
		if ( !( n % i ) )
		{
			return false;
		}
	}

	return true;
}

int main()
{
	int n, count = 0;

	while ( cin >> n )
	{
		for ( int i = 2; i <= n; i++ )
		{
			if ( isPrime( i ) )
			{
				count++;
			}
		}

		printf("%d\n", count );
	}

	return 0;
}