#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int MAXN = 1000000;
int prime[MAXN + 1];
void getPrime()
{
    memset(prime, 0, sizeof(prime));
    for (int i = 2; i <= MAXN; i++)
    {
        if (!prime[i])
        {
            prime[++prime[0]] = i;
        }
        for (int j = 1; j <= prime[0] && prime[j] <= MAXN / i; j++)
        {
            prime[prime[j] * i] = 1;
            if (i % prime[j] == 0)
            {
                break;
            }
        }
    }
}
int main()
{
	getPrime();
	int n,sum;
	while(~scanf("%d",&n)){
		sum=0;
		for(int i=1;i<MAXN;i++){
			if(prime[i]<=n){
				sum++;
			}else{
				break;
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}
