//
//  main.cpp
//  gcd
//
//  Created by Syngnath on 15/12/16.
//  Copyright ? 2015年 Syngnath. All rights reserved.
//
#include <iostream>
#include <cmath>
#include <cstdio>



int primeNumDector(int MAX) {
    int counter;
    bool isPrime[MAX];
    for (int i = 0; i <= MAX;i++)
        isPrime[i] = true;
    
    isPrime[0] = isPrime[1] = 0;
    
    for (int i = 2;i <= (int)sqrt(MAX); i++) {
        if(isPrime[i]) {
            for ( int j = 2*i; j <= MAX;j += i)
                isPrime[j]=0;
        }
    }
    
    for(int i = 2;i <= MAX;i++)
        if(isPrime[i])
            counter++;
    
    return counter;
}


int main()
{
    int n;
    while(scanf("%d",&n) != EOF) {
        int ans = primeNumDector(n);
        printf("%d\n",ans);
    }
}