#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pb push_back

# define inOut(a,b) freopen(a,"r",stdin);freopen(b,"w",stdout);
# define RESET(a) memset(a,0,sizeof(a))
# define MEMO(a) memset(a,-1,sizeof(a))
# define DEBUG puts("Debug-Has-Come-Until-Here")


typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define MAXPRIME 1000000

bitset<MAXPRIME+1> boolPrime(0);
int prefPrime[1000001] ={};

void sieve(int n){
	int i,j;
	boolPrime[1] = 1;
	for (i=2; i<=sqrt(n); i++){
		if (boolPrime[i] == 0)
		for (j=2*i; j<=n; j+=i){
			boolPrime[j] = 1;
		}
	}
}

int main(){
	cin.tie(NULL);
	
	int i,j,n = 0;
	sieve(MAXPRIME);
	for (i=1; i<=MAXPRIME; i++){
		n += !boolPrime[i];
		prefPrime[i] = n;
	}
	while(scanf("%d", &n) != EOF){
		printf("%d\n", prefPrime[n]);
	}
	return 0;
}