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

vector<int> sieve;

void make_prime(){
  bool a[1000001];
  for(int i = 0; i <= 1e6; i++)a[i] = false;
  a[0] = true;
  a[1] = true;
  for(int i = 2; i <= 1e6; i++){
    if(a[i])continue;
    sieve.push_back(i);
    for(int j = i; j <= 1e6; j += i){
      a[j] = true;
    }
  }
}

int main(){
  int n;
  make_prime();
  while(cin >> n){
    int cnt = 0;
    for(int i = 0; sieve[i] <= n; i++)cnt++;
    cout << cnt << endl;
  }
}