#include<iostream>
#include<math.h>

using namespace std;

int main(){
	int n,i,j,buf,cnt;
	bool flag;

	while(cin >> n){
		if(n == 1){
			cout << "0" << endl;
			continue;
		}

		cnt = 1;

		for(i=3;i<=n;i+=2){
			flag = false;
			buf = (int)sqrt((double)i);

			for(j=3;j<=buf;j+=2){
				if((i % j) == 0){
					flag = true;
					break;
				}
			}

			if(flag == false;){
				cnt++;
			}
		}

		cout << cnt << endl;
	}

	return 0;
}