#include <iostream>
using namespace std;

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

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