#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 main()
{
	int n, count;

	while ( cin >> n )
	{
		bool table[1000000];
		count = 0;

		for ( int i = 0; i <= n; i++ )
		{
			table[i] = true;
		}

		for ( int i = 2; i <= n; i++ )
		{
			if ( table[i] )
			{
				count++;
				for ( int j = 2; i * j <= n; j++ )
				{
					table[i*j] = false;
				}
			}
		}

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

	return 0;
}