#include <cstdio>
#include <iostream>
#include <vector>
#define pb push_back
using namespace std;

int primes(int n) {
  int cnt=0;
  vector<bool> pri(n+1,false);
  for(int i=2;i<=n;i++) {
    if(pri[i]==false) {
      cnt++; pri[i]=true;
      for(int j=i*2;j<=n;j+=i) {
	pri[j]=true;
      }
    }
  }
  return cnt;
}


main() {
  int n;
  while(cin>>n) {
    cout << primes(n) << endl;
  }
}