#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <stdio.h>
using namespace std;
int isprime(int x){
    int a[x],b=0;
    for(int i=0;i<x;i++){
        a[i]=i+1;
    }
    for(int i=0;i<x;i++){
        if(a[i]==2||a[i]==3) b++;
        if(a[i]<5||a[i]%2==0||a[i]%3==0)goto exit;
    else{
        int j=5;
        while(j<sqrt(x)){
            if(a[i]%j==0)goto exit;
            j = j+2;
        }
        b++;
    }
    exit:;
}
    return b;
}
int main() {
    int n;
    while(cin >> n){
        cout << isprime(n) << endl;
        }
    }

