#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<climits>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = INT32_MAX / 3;
const ll MOD = 1e9 + 7;

int dx[4] = { 1,0,0,-1 };
int dy[4] = { 0,1,-1,0 };


/******************************************************************************************/


/*nまでの素数を列挙して配列に保持*/
vector<ll> Eratosthenes(ll n) {

	vector<ll> arr(n);
	for (ll i = 0; i < n; i++) {
		arr[i] = 1;
	}
	arr[0] = arr[1] = 0;
	for (ll i = 2; i < sqrt(n); i++) {
		if (arr[i]) {
			for (ll j = 0; i * (j + 2) < n; j++) {
				arr[i * (j + 2)] = 0;
			}
		}
	}
	return arr;
}


int main() {

	int n;
	
	vector<ll> prime = Eratosthenes(1000005);

	for (int i = 0; i < prime.size()-1; i++)
	{
		prime[i + 1] += prime[i];
	}

	while (cin >> n) {
		cout << prime[n] << endl;
	}

	
	return 0;
}
