#include <iostream>
using namespace std;
int main(int argc, char *argv[]){
	int n;
	while(cin>>n){
		bool check[999999]={false};
		int count=0;
		for(int i=2;i<=n;i++){
			if(!check[i]){
				for (int j = 1; i*j <= n;j++){
					check[i*j]=true;
				}
				count++;
			}
		}
		cout<<count<<endl;
	}
	return 0;
}