#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;


int main(){
  int prime[1000000];
  fill(prime,prime+1000000,1) ;
  prime[0] = prime[1] = 0;
  for(int i = 2 ; i*i < 1000000 ; i++ ){
    if(prime[i])for(int j = i*2; j <1000000; j+=i)prime[j] = 0;
  }

  int n;
  while( cin >> n ){
    int cnt = 0;
    for(int i = 2 ; i <= n ; i++ ){
      if(prime[i])cnt++;
    }
    cout << cnt << endl;
  }
}