#include<iostream>
#include<algorithm>

using namespace std;
const int MAX = 1000000;
int data[MAX];

void make(){
  fill(data,data+MAX,1);
  
  for(int i = 2; i*i < 1000000; i++){
    if(data[i] == 1){
      for(int j = i*2; j < 1000000; j+=i) data[j] = 0;
    }
  }
}

int main(){
  make();
  int in;
  while(cin >> in){
    
    int sum = 0;
    for(int i = 2; i <= in; i++){
      if(data[i] == 1) sum++;
    }
    
    cout << sum <<endl;
  }
  return 0;
}