#include <cstdio>
#define SIZE 1000001

int main(void)
{
  int i, j, k, n;
  int memo[SIZE] = {};

  memo[0] = 1;
  memo[1] = 1;
  for (i = 2; i <= SIZE; i++) {
    if (memo[i] == 0) {
      for (j = i * 2; j <= SIZE; j = j + i) {
        memo[j] = 1;
      }
    }
  }
  
  while (scanf("%d", &n) != EOF) {
    k = 0;
    for (i = n; i > 0; i--) {
      if (memo[i] == 0) k++;
    }
    std::printf("%d\n", k);
  }
}

