#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int box[1000005];
int main()
{
	for(int i=0;i<=999999;i++)
		box[i]=1;
	box[1]=box[0]=0;
	int n;
    int rooted=sqrt(999999);
    for(int i=2;i<=rooted;i++)
        if(box[i])
            for(int j=2;j*i<=999999;j++)
                box[j*i]=0;
	while (cin >> n)
	{
		int s=0;
		for (int i=1;i<=n;i++)
			s+=box[i];
		cout << s << endl;
	}
}