#include<cstdio>

#define MAX 1200000
using namespace std;
int prim[1200100];
int prima[1200100];
int main() {
    int n, i, x = 0;
    for (i = 2; i <= MAX; i++) {
        prim[i] = i;
    }
    for (i = 2; i <= MAX; i++) {
        if (prim[i] != 0) {
                  prima[x] = prim[i];
                  x+= 1;
                  int j = i;
                  while ( j <= MAX) {
                        prim[j] = 0;
                        j+= i;
                  }
        }
    }
    while (scanf("%d", &n) != EOF) {
          int a = 0;
          while ( prima[a] <= n) {
                a++;
          }
          printf("%d\n", a);
    }
    return 0;
}