#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

const int MAX_N = 1000000;

bool sieve[MAX_N];
int num[MAX_N];

int main()
{
  memset(sieve, true, sizeof sieve);

  sieve[0] = sieve[1] = false;
  int n = 0;
  for (int i = 2; i < MAX_N; i++) {
    if (sieve[i]) {
      n++;
      for (int j = 2 * i; j < MAX_N; j += i) {
        sieve[j] = false;
      }
    }
    num[i] = n;
  }

  int a;
  while (scanf("%d", &a) != EOF) {
    printf("%d\n", num[a]);
  }

  return 0;
}

