#include<cstdio>
using namespace std;
const int MAX = 1200000;
bool prime[MAX];
int solve(int n){
  int cnt = 1;
  if(n == 1)
    return 0;
  else if(n == 2)
    return 1;
  else{
    for(int i = 3 ; i <= n ; i++){
      if(prime[i])
        cnt++;
    }
  }
  return cnt;
}
int main(){
  for(int i = 0 ; i < MAX ; i++)
    prime[i] = true;
  prime[0] = prime[1] = false;
  for(int i = 4 ; i < MAX ; i += 2)
    prime[i] = false;
  for(int i = 3 ; i < MAX ; i += 2){
    if(prime[i]){
      for(int j = i * 2 ; j < MAX ; j += i)
        prime[j] = false;
    }
  }
  int n;
  while(scanf("%d",&n) != EOF){
    printf("%d\n",solve(n));
  }
}


