#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define Max 1000000
bool vis[Max];
int prime[Max],cnt;
void print_prime()
{
    memset (vis,false,sizeof (vis));
    for (int i=2;i<=sqrt(Max);i++)
        if (!vis[i])
        for (int j=i*i;j<=Max;j+=i)
        vis[j]=true;
    for (int i=2;i<=Max;i++)
        if (!vis[i])
        prime[cnt++]=i;
}
int main()
{
    print_prime();
    int n;
    while (scanf("%d",&n)!=EOF) {
        int i=0;
        while (prime[i]<=n) {
            i++;
        }
        printf("%d\n",i);
    }
    return 0;
}