#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

int n, i, cnt, num[999999];

bool is_prime(int k)
{
	if(k == 1)  return false;
	if(k == 2)  return true;
	for(int i = 2; i*i <= k; i++){
		if(k%i == 0)  return false;
	}
	return true;
}

int count_prime()
{
	for(i = 1; i <= 999999; i++){
		if(is_prime(i))  cnt++;
		num[i] = cnt;
	}
	return 0;
}

int main()
{
	count_prime();
	while(scanf("%d", &n) != EOF){
		printf("%d\n", num[n]);
	}
	return 0;
}