#include <iostream>
using namespace std;

bool dec(int i, int prime[]) {
  for (int j = 0; prime[j] != 0; j++) {
    if (i % prime[j] == 0) {return false;}
  }
  return true;
}

int main() {
  int n;
  while (cin >> n) {
    int count = 0;
    int prime[1000000];
    for (int i = 0; i < 1000000; i++) {
      prime[i]=0;
    }
    if (n >= 2) {
      prime[0] = 2;
      count++;
    }
    for (int i = 3; i <= n; i += 2) {
      if (dec(i, prime)) {
	prime[count] = i;
	count++;
      }
    }
    cout << count << endl;
  }
  return 0;
}
