#include <cstdio>

typedef long long LL;

int p[100010];
bool np[1000010];
int cntp;

void SievePrime(int n) {
  LL t;
  for(int i = 2; i <= n; ++i) {
    if(!np[i]) p[cntp++] = i;
    for(int j = 0; j < cntp && (t = 1ll * i * p[j]) <= n; ++j) {
      np[t] = true;
      if(i % p[j] == 0) break;
    }
  }
}

int main() {
  SievePrime(1000000);
  int n;
  while(scanf("%d", &n) != EOF) {
    int ans = 0;
    for(int i = 2; i <= n; ++i) {
      if(!np[i]) ++ans;
    }
    printf("%d\n", ans);
  }
  return 0;
}