#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

int IsPrime(int n){
    int i;

    for(i = 3; i * i <= n; i += 2)
         if(n % i == 0)
            return 0;
    return 1;
}

int main()
{
	int in;
	
	while(scanf("%d",&in) != EOF){
		int c = 0;

		for(int i=3;i<in;i+=2)
			if(IsPrime(i) == 1)
				++c;

		if(in >= 2)	++c;
		
		cout << c << endl;
	}

	return 0;
}