#include<iostream>
#include<string.h>

using namespace std;

long long int seive(int n)
{
	bool arr[n+1];
	memset(arr, true, sizeof(arr));
	for(long long int i = 2; i*i <= n; i++){
		if(arr[i] == true){
			for(long long int j = 2*i; j <= n; j += i){
				arr[j] = false;
			}
		}
	}
	long long int cnt = 0;
	for(long long int i = 2; i <= n; i++){
		if(arr[i] == true){
			cnt++;
		}
	}
	return cnt;
}
int main()
{
	long long int n;
	
	cin >> n;
	
	cout << seive(n) << endl;
	
	
	return 0;
}