#include<iostream>
#include<cstdio>
#include<fstream>
#include<cstdlib>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<cstring>
#include<ctime>
#include<climits>
#include<ctype.h>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
#define PI acos(-1.0)
#define eps 1e-12
const int INF_INT = 2147483647;
const ll INF_LL = 9223372036854775807LL;
const ll N = 1e6+1;
const int MOD = 1e9+7;
bool flag = true;
int prime[N];
bool check[N]{0};
int main()
{
	//    freopen("C:\\Users\\Administrator\\Desktop\\in.txt","r",stdin);
	//    freopen("C:\\Users\\Administrator\\Desktop\\out.txt","w",stdout);
	//%%%llaa
    int i,j,n,tot=0;
    for(i=2;i<N;i++)
    {
        if(!check[i])
        {
            prime[tot++]=i;
            for(j=i+i;j<N;j+=i)
                check[j]=1;
        }
    }
    int p=30;
    while(~scanf("%d",&n)&&p)
    {
        p--;
        int num=0;
        i=0;
        while(prime[i++]<=n)
            num++;
        printf("%d\n",num);
    }
	return 0;
}


/*

*/

