#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
  int n;
  int cont;
  while(scanf("%d",&n)!=EOF){
    int a[1000000]={0};
    int cont=0;
    a[1]=1;
    for(int i=2;i<=sqrt(n);i++){
      if(a[i]==0){
      for(int j=2;j<=n;j++){
	a[i*j]=1;
      }
    }
    }
    for(int i=1;i<=n;i++){
      if(a[i]==0)cont++;
    }
    cout<<cont<<endl;
  }
}