#include <iostream>
#include <cmath>

typedef long long LL;
using namespace std;

const int X = 1000001;
bool isPrime[X];

void init(){
  for(int i=0;i<X;i++){
    isPrime[i] = false;
  }
  isPrime[2] = true;
  for(int i=3;i<X;i+=2){
    cout << i << endl;
    bool ok = true;
    for(int j=2;j<=sqrt(i);j++){
      if(!isPrime[j])continue;
      if(i%j==0)ok=false;
    }
    if(ok)isPrime[i] = true;
  }
}

int main(){
  init();
  int n;
  while(cin >> n){
    int answer = 0;
    for(int i=0;i<n+1;i++){
      if(isPrime[i])answer++;
    }
    cout << answer << endl;
  }
  return 0;
}