#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
  int n,k;
  vector<int> vi;
  vi.push_back(2);
  for(int i=3;i<=999999;i+=2){
    k=0;
    for(int j=3;j<=sqrt(i);j+=2){
      if(i%j==0){
	k=1;
	break;
      }
    }
    if(k==0)vi.push_back(i);
  }	
  while(cin>>n){
    int l;
    for(l=0;vi[l]<=n;l++);
    cout<<l<<endl;
  }
  return 0;
}