#include <bits/stdc++.h>
using namespace std;
using ll = long long;
static constexpr ll LIM = 1e10;

constexpr ll mpow(const ll base, const ll exp) {
    if (!exp) return 1;
    if (exp % 2LL) return base * mpow(base, exp - 1LL);
    const ll q = mpow(base, exp / 2LL);
    return (q * q);
}

set<ll> all_powers() {
    set<ll> ans;

    for (ll a = 2LL; log2(a) * 2.0 < log2(2.0 * LIM); ++a) {
        for (ll b = 2LL; b * log2(a) < log2(2.0 * LIM); ++b) {
            const ll c = mpow(a, b);
            assert(c > 0LL);
            ans.insert(c);
        }
    }

    return ans;
}

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

    ll n;
    cin >> n;

    const auto ps = all_powers();

    const auto it = ps.upper_bound(n);
    const ll c = distance(cbegin(ps), it);
    const ll ans = n - c;

    cout << ans << '\n';
    return 0;
}

// DeNsE - EcLiPsE //
// WHAT is DEAD may NEVER die //

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <unordered_map>
#include <cmath>
#include <iomanip>
#include <set>
#include <cstring>
#include <stack>
#include <sstream>
#include <queue>
#include <unordered_set>
#include <cstdlib>
//#include <bits/stdc++.h>

using namespace std;

#define nitro ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define int long long
#define double long double

const int inf = (1ll << 62) - 1;
const int mod = 998244353;
const int N = 2e5 + 10;

int bPow(int a, int b){
    int res = 1;
    while(b) {
        if (b & 1) {
            res = (res * a) % mod;
        }
        b >>= 1;
        a = (a * a) % mod;
    }
    return res % mod;
}

int gcd(int a, int b)
{
    if(a < b)
        swap(a, b);
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

vector<int> fact(N, 0ll);
void factorial(){
    fact[0] = 1, fact[1] = 1;
    for(int i = 2; i < N; i++){
        fact[i] = (fact[i - 1] * i) % mod;
    }
}

int ncr(int n, int r){
    if(r > n)
        return 0;
    int ans = fact[n] % mod;
    ans *= bPow(fact[r], mod - 2) % mod;
    ans %= mod;
    ans *= bPow(fact[n - r], mod - 2) % mod;
    ans %= mod;
    return ans;
}

set<int> canBe;

void countPowers(int x, int n){
    int cur = x, ct = 0;
    while(cur * x <= n){
        ct++;
        cur *= x;
        canBe.insert(cur);
    }
}

void solve(){
    int n;
    cin >> n;
    for (int i = 2; i * i <= n; ++i) {
        countPowers(i, n);
    }
    cout << n - canBe.size() << endl;
}

signed main(){
    nitro
    int tc = 1;
    //cin >> tc;
    while(tc--){
        solve();
    }
}