#include <stdio.h>
int main(){
    int mem[ 50000 ] = { 2,3,5,7,11 };
    int i,m = 5,x;
    for( i = 12;i < 100000;i++ ){
        if( i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0 && i % 11 != 0 ) mem[ m++ ] = i;
    }
    while( 1 ){
        if( feof( stdin ) != 0 ) break;
        scanf( "%d",&x );
        for( i = 0;mem[i] <= x;i++ );
        printf( "%d\n",i );
    }
    return 0;
}