#include<iostream>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;

bool d[1000000];

int main()
{
  int n;
  int ans;
  while(cin >> n)
  {
    n++;
    for(int i = 0; i < 1000000; i++)
      d[i] = false;
    d[0] = d[1] = true;
    ans = 0;
    for(int i = 2; i < n; i++)
    {
      if(d[i])
        continue;
      for(int j = i + i; j < n; j+= i)
        d[j] = true;
    }
    for(int i = 0; i < n; i++)
    {
      //cout << d[i] << endl;
      ans += !d[i] ? 1 : 0;
    }
    cout << ans << endl;
  }
  return 0;
}