#include <iostream>
#include <bitset>
using namespace std;
bitset<1000000> p;
int main(){
  p.flip();
  p[0] = 0;
  p[1] = 0;
  for(int i = 2; i < 1000; ++i){
    if(p[i]){
      for(int j = 2*i; j < 1000000; j += i) p[j] = 0;
    }
  }
  int n;
  while(cin >> n){
    int ret = 0;
    for(int i = 2; i <= n; ++i) ret += p[i];
    cout << ret << '\n';
  }
  return 0;
}
