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

int main(){
    vector<int> isprime;
    int n;
    cin >> n;
    for (int i = 0; i <= n; i++){
	isprime.push_back(1);
    }

    int prime = 0;
    for (int i = 2; i <= n; i++){
	if (isprime[i]){
	    prime++;
	    for (int j = 2; i * j <= n; j++) isprime[i*j] = 0;
	}
    }
    cout << prime << endl;
    
    return 0;
}