#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<utility>
#include<stack>
#include<queue>
#include<list>
#include<bitset>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000

using namespace std;

int main(void) {
	while (1) {
		int n;
		int count = 1;
		cin >> n;
		if (n == 1) {
			cout << 0 << endl;
		}
		else if (n == 2) {
			cout << 1 << endl;
		}
		else {
			for (int t = 3; t <= n; t += 2) {
				FOR(i, 2, t - 1) {
					if (t%i == 0) {
						break;
					}
					if (i == t - 1) {
						count++;
						break;
					}
				}
			}
			cout << count << endl;
		}
	}
	
	
	return 0;
}
