#include <bits/stdc++.h>
using namespace std;
using lint = long long;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0);

	lint n;
	cin >> n;
	
	lint count = 0;
	set<lint> s;
	for (lint i = 2; i * i <= n; i++) {
		for (int j = 2; j <= 40; j++) {
			lint tmp = pow(i, j);
			if (1 <= tmp and tmp <= n) {
				if (s.find(tmp) == s.end()) {
					s.insert(tmp);
					count++;
				}
			}
		}
	}
	cout << n - count;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

int main() {
    long long n;
    cin >> n;
    set<long long> s;
    for (long long a = 2; a * a <= n; ++a) {
        long long x = a * a;
        while ( x <= n) {
            s.insert(x);
            x *= a;
        }
    }
    cout << n - s.size() << endl;

    return 0;
}