#include <iostream>
#include <vector>
using namespace std;

#define N 1000000
int main() {
  vector<int> table(N,1);
  table[0]=table[1]=0;
  for (int i=2; i*i<N; i++)
    if (table[i])
      for (int j=i*2; j<N; j+=i)
        table[j] = 0;
  int n;
  while(cin>>n) {
    int ans=0;
    for (int i=2;i<=n;i++) {
      if (table[i]) ans++;
    }
    cout << ans << endl;
  }
}