#include <stdio.h>
#include <string.h>
#include <iostream>

using namespace std;

int sum[100100];
int bprime[1000100];

int main() {
  memset(bprime, true, sizeof(bprime));
  bprime[0] = bprime[1] = false;
  for (int i = 2; i < 1000000; i++) {
    if (!bprime[i]) { continue; }
    for (int j = i + i; j < 1000000; j += i) {
      bprime[j] = false;
    }   
  }
  sum[0] = 0;
  for (int i = 1; i < 1000000; i++) {
    sum[i] = sum[i - 1] + (bprime[i] ? 1 : 0); 
  }
  int n;
  while (scanf("%d", &n) > 0) {
    printf("%d\n", sum[n]);
  }
}