#include<iostream>
using namespace std;
const int N = 1000100;
int he[N];//合数
int prime[N];//质数
int cnt, n;
int main() {
cin >> n;
for (int i = 2; i <= n; i ++ ) {
if (!he[i]) prime[cnt ++ ] = i;
for (int j = 0; prime[j] <= n / i; j ++ ) {
he[i * prime[j]] = 1;
if (i % prime[j] == 0) break;
}
}
cout << cnt << endl;
return 0;
}