#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <list>
#include <vector>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <sstream>
#include <complex>
#include <bitset>
#include <iomanip>
#include <cctype>
#include <limits>
#include <numeric>
#include <cmath>
#include <functional>
#include <queue>
#include <cstring>

using namespace std;

typedef unsigned int uint;
typedef unsigned long long ull;

#define FORE(k,a,b) for(int k=(a); k <= (int)(b); ++k)
#define FOR(k,a,b) for(int k=(a); k < (int) (b); ++k)

#define pb push_back
#define mp make_pair
#define sfi(a) scanf("%d",&a)
#define pfi(a) printf("%d\n",&a)

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<uint> uvi;
typedef vector<uvi> uvvi;
typedef vector<vd> vvd;
typedef pair<int,int> ii;
typedef vector<pair<int,int> > vii;
typedef vector<vii> vvii;
typedef pair<uint,uint> uu;
typedef map<string, int> msi;
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define FOR_IT(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define contains(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())

#define MAX 100000000
#define LMT 10000

int a[10000000];

int main()
{
	int i,j,n,cnt=0;
	while(scanf("%d",&n)==1)
	{
		cnt=0;

		memset(a,0,sizeof(a));

		for(i=2;i<=n;++i){
			if(a[i]==0){
                for(j=i*i;j<=n;j+=i)
                a[j]=-1;

                cnt++;
			}
		}
		printf("%d\n",cnt);
	}
	return 0;
}