#include<iostream>
#include<math.h>
using namespace std;
bool IsPrime(int num){
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; 

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
            return false;
    }
    return true;
}
int main() {
  int n;
  while(cin>>n) {
    int count=0;
    for(int i=1;i<=n;i++){
      if(IsPrime(i))
	count++;
    }
    cout<<count<<endl; 
 }
  return 0;
}

