#include <bits/stdc++.h> 
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()

int main() {
   
ll N;
cin>>N;
ll n=sqrt(N);
ll ans=N;
vector<bool> vec(n,false);
for(ll i=2;i<=n;i++) {
    if(vec[i-1]) {
        continue;
    }
    ll k=i;
    ans++;
    while(k<=N) {
        ans--;

        if(k<=n) vec[k-1]=true;
        k*=i;
    }
}

cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
#define vi vector<int>
#define vl vector<ll>

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


ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t%mod;
    }
    return n*rep_jijo(n,x-1)%mod;
}


int main()
{
    ll n;
    ll ans = 0;
    cin >> n;
    map<ll, int>mp;

    for(ll i = 2; i * i <= n; i++) {
        ll now = i * i;

        while(now <= n) {
            //cout << now << endl;
            if(now <= n) {
                mp[now]++;
            } else {
                break;
            }
            now = now * i;
        }
    }

/*
    for(ll i = 2; i * i <= n; i++) {

        ll now = i * i * i * i;
        if(now > n) break;
        while(now <= n) {
            if(now <= n) ans--;
            else break;
            now = now * i;
        }
    }
    */

    cout << n - mp.size() << endl;
    return 0;
}