#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
#include <cctype>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)n; ++i)

int main()
{
	int n;
	int c;

	while(cin >> n) {
		c = 0;

		vector<int> P(n);
		REP(i, n) P[i] = 1;

		P[0] = 0;

		for(int i = 1; i * i < n; ++i) {
			if(P[i] == 1) {
				for(int j = i + 1; j * (i + 1) - 1 < n; ++j) {
					P[j * (i + 1) - 1] = 0;
				}
			}
		}

		REP(i, n) {
			if(P[i] == 1)
				++c;
		}

		cout << c << endl;
	}
	return 0;
}