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

int main()
{
	int n, i, j, count;

	while(scanf("%d", &n) != EOF){
		count = n - 1;

		for (i = 2; i <= n; i++){
			for (j = 2; j <= sqrt(i); j++){
				if(i%j == 0) {count--; break;}
			}
		}

		printf("%d\n", count);
	}

	return 0;
}