#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;
int vis[1000000];
int n;int sum;
void pre()
{
    memset(vis, 0, sizeof(vis));
for(int i = 2; i <= 999999; i++)
	for(int j = i*2; j <= 999999; j += i)
		vis[j] = 1;
}
int main()
{
    pre();
    while(scanf("%d",&n)!=EOF)
    {
        sum=0;
        for(int i=2;i<=n;i++)
        {
            if(!vis[i])
                sum++;
        }
        printf("%d\n",sum);
    }
    return 0;
}