#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);++i)
using ll = long long;
using P = pair<int, int>;
using C = complex<double>;


int main() {
	ll n;
	cin >> n;
	set<ll> s;
	for (ll a = 2; a * a <= n; ++a) {
		ll x = a * a;
		while (x <= n) {
			s.insert(x);
			x *= a;
		}
	}
	cout << n - s.size() << endl;
}
#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#include "/debug.h"
#else
#define db(...)
#endif

#define all(v) v.begin(), v.end()
#define pb push_back
using ll = long long;
const int NAX = 2e5 + 5, MOD = 1000000007;

int64_t solveCase(int64_t N)
{
    // TODO: edit here
    set<int64_t> ss;
    for (int64_t i = 2; i <= N; i++)
    {
        if (ss.find(i) != ss.end())
            continue;
        auto j = i * i;
        if (j > N)
            break;
        while (j <= N)
        {
            ss.insert(j);
            j *= i;
        }
        db(i, j);
    }
    return N - ss.size();
}

// generated by oj-template v4.7.2 (https://github.com/online-judge-tools/template-generator)
int main()
{
#ifndef LOCAL
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif
    constexpr char endl = '\n';
    int64_t N;
    cin >> N;
    auto ans = solveCase(N);
    cout << ans << endl;
    return 0;
}