#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
bool hurui[1000000];
int main(){
    int n;
    while(scanf("%d",&n) != EOF){
        for(int i = 0;i <= n;i++)
            hurui[i] = true;

        for(int i = 2;i <= (int)sqrt(n);i++) {
            if(!hurui[i])
                continue;
            int m = i * 2;
            while(m <= n) {
                hurui[m] = false;
                m += i;
            }
        }
        int cou = 0;
        for(int i = 2;i <= n;i++) {
            if(hurui[i]) {
                cou++;
            }
        }
        printf("%d\n",cou);
    }
    return 0;
}