#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include<algorithm>
#define pf printf
#define sf scanf

using namespace std;

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

int main()
{
    int n;
	bool arr[1000000] = {false};
	for(int i=0;i<1000000;i++){
		arr[i] = isprime(i);
	}
	while(cin >> n){
		int coun=0;
		for(int i=0;i<=n;i++){
			if(arr[i]==true)coun++;
		}
		printf("%d\n",coun);
	}
    return 0;
}