
#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <vector>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned ll
#define db double
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PII pair<int, int>

const int N=1000000;
bool p[N+10];
vector<int> primes;

int main()
{
    for (int i=2;i<=N;i++) {
        if (!p[i]) primes.pb(i);
        for (int j=0;j<primes.size()&&primes[j]*i<=N;j++) {
            p[primes[j]*i]=1;
            if (i%primes[j]==0) break;
        }
    }
    int n;
    while (~scanf("%d",&n)) {
        int ans=upper_bound(primes.begin(),primes.end(),n)-primes.begin();
        printf("%d\n",ans);
    }
}
