/*
 * main.cpp
 *
 *  Created on: 2011/04/08
 *      Author: satoki
 *      5:09 ~ 6:03
 *      Wrong Answer : 2
 *      nÈºÌfð¢ÅÀ
 *      Runtime Error : 4
 *      PÂ½ßÉfðZbg
 */
#include <iostream>
#include <string.h>
using namespace std;

int iN;
int iDp[78499];

void init() {
  int i, j, cnt = 0;
  for (i = 2; i < 1000004; i++) {
    for (j = 0; j < cnt; j++) {
      if (iDp[j] * iDp[j] > i) {
        j = cnt;
        break;
      } else if (i % iDp[j] == 0) break;
    }
    if (j == cnt) {
      iDp[cnt] = i;
      cnt++;
    }
  }
}

bool input() {
  if (scanf("%d", &iN) == EOF) return false;
  return true;
}

int manage() {
  int i;
  for (i = 0; iDp[i] <= iN; i++);
  return i;
}

int main() {
  init();
  while (1) {
    if (!input()) break;
    printf("%d\n", manage());
  }
  return 0;
}