#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>

using namespace std;

bool t[1000000];

int main(){
	memset(t,1,sizeof(t));
	t[0] = t[1] = false;
	for(int i = 2; i < 1000; i++){
		if(t[i])
			for(int j = 2 * i; j < 1000000; j += i){
				t[j] = false;
			}
	}

	int n;
	while(cin>>n){
		int ans = 0;
		for (int i = 0; i <= n; i++)
		{
			ans += t[i];
		}
		cout << ans << endl;
	}

	return 0;
}