#include <iostream>
#include <cmath>
using namespace std;
bool whether(int num);
int count(int num);

int main(){
    int n;
    while(cin>>n){ cout <<count(n)<<endl; }
    return 0;
}

bool whether(int num){//if num is prime, 1
    int s=sqrt(num);
    for(int i=3; i<=s; i+=2){
        if(num%i==0){ return 0; }
    }
    return 1;
}

int count(int num){
    int a=1;
    if(num<=2){ return num-1; }
    for(int i=3; i<=num; i+=2){
        if(whether(i)){ a+=1; }
    }
    return a;
}