#include<bits/stdc++.h>
using namespace std;

vector<int> sieve;

void make_prime(int n){
  bool a[1000000];
  for(int i = 0; i < 1e6; i++)a[i] = false;
  a[0] = true;
  a[1] = true;
  for(int i = 2; i <= n; i++){
    if(a[i])continue;
    sieve.push_back(i);
    for(int j = i; j <= n; j += i){
      a[j] = true;
    }
  }
}
int main(){
  int n;
  cin >> n;
  make_prime(n);
  cout << sieve.size() << endl;
}