#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define INF 1<<25
#define LIM 1000000

using namespace std;

int n,sum,out;
bool prm[1000000];

void eucprime()
{
	FOR(i, 2, LIM)
	{
		if(prm[i] == 0)
		{
			for( int j = 2; j*i < LIM; j++)
			{
				prm[i*j] = 1;
			}
		}
	}
}
	

int main()
{
	while( cin >> n, !cin.eof())
	{
		CLR(prm);
		prm[0] = 1; prm[1] = 1;
		eucprime();
		
		int cnt=0;
		
		FOR(i, 0, n+1)
		{
			if(prm[i] == 0)
				cnt++;
		}
		
		cout << cnt << endl;
	}
	
	return 0;
}