#include <bits/stdc++.h>
using namespace std;
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X)
#define debug(x) cerr<<#x<<':'<<x<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto x:v)cerr<<x<<' ';cerr<<endl;
#define INF 1000000007
#define LINF 1000000000000000007
#define EPS 1e-9
typedef long long ll;

vector<long long> primelist(long long n){
  vector<bool> prime(n+1,1);
  for(long long i = 2;i <= n;i++){
    if(prime[i]){
      for(long long j = 2*i;j <= n;j += i){
        prime[j] = 0;
      }
    }
  }
  prime[0] = 0;
  prime[1] = 0;
  vector<long long> primelist;
  for(long long i = 0;i <= n;i++)if(prime[i])primelist.pb(i);
  return primelist;
}

signed main(){
  int n;
  while(cin >> n){
    cout << primelist(n).size() << endl;
  }
}
