#include <stdio.h>
#include <math.h>

int sosu( int n ) {
	int i , lim = (int)(sqrt(n));
	
	if ( n == 2 ) return 1;
	if ( n % 2 == 0 ) return 0;
	
	for ( i = 3; i <= lim; i+=2 ) {
		if ( n % i == 0 ) return 0;
	}
	return 1;
}

int main (void) {
	int n , i , count = 0;
	
	while ( scanf("%d",&n) != EOF ) {
		for ( i = 2; i <= n; i++ ) {
			if ( sosu(i) ) count++;
		}
		printf("%d\n",count);
	}
	return 0;
}