#include <stdio.h>
int prime_finder(int i){
    int j;
    for(j=2;j<=i/2;j++){
        if(i%j==0){
            return 0;
        }
    }
    return 1;
}
int main(){
    int n,i,k,j;
    while (scanf ("%d",&n) != EOF && n<=999999 )
    {
        j=0;
        for(k=2;k<=n;k++){
            if(prime_finder(k)==1){
                j++;
            }
        }
        printf("%d\n",j);
    }
    return 0;
}