#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = a; i >= (n); i--)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	bool isprime[1000000];
  rep(i, 1000000) isprime[i] = true;
  isprime[0] = isprime[1] = false;
  FOR(i, 2, sqrt(1000000)) {
    if(isprime[i]) {
      ll j = i + i;
      while(j <= 1000000) {
        isprime[j] = false;
        j += i;
      }
    }
  }
  ll n;
  while(cin >> n) {
    ll cnt = 0;
    rep(i, n + 1) if(isprime[i]) cnt++;
    cout << cnt << endl;
  }
	return 0;
}
