#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

const int MAXN = 1000005;
int num[MAXN];

int main() {
  fill(num, num+MAXN, 1);
  num[0] = num[1] = 0;
  for(int i = 2; i < MAXN; ++i) {
    if(!num[i]) continue;
    for(int j = i*2; j < MAXN; j += i) num[j] = 0;
  }
  for(int i = 1; i < MAXN; ++i) {
    num[i] += num[i-1];
  }
  int n;
  while(cin >> n) {
    cout << num[n] << endl;
  }
  return 0;
}