/*

ll fastmod(ll x,ll y)
{
    ll res=1;
    if(x%mod==0)
        return 0;
    while(y>0)
    {
        if(y&1)
           res=(res*x)%mod;
        y=y>>1;
        x=(x*x)%mod;
    }
    return res;
}
}*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fo(i,n) for(ll i=0;i<n;i++)
#define Fo(i,k,n) for(ll i=k;i<n;i++)
#define rev(i,n) for(ll i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define tr(it,v) for(auto it=v.begin(),it!=v.end();it++)
#define vin(v,k) fo(i,k)cin>>a,v.pb(a);
#define deb(x) cout<<#x<<" "<<x<<'\n';
#define mod 1000000007
#define siz 100010
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);


/*ll arr[250010];


struct node
{
    ll val,zcnt,ocnt,tcnt;
    node(val=0,zcnt=0,ocnt=0,tcnt=0)
    {
        val(val),zcnt(zcnt),ocnt(ocnt),tcnt(tcnt);
    }
}


node merge(node a,node b)
{

}
*/

ll fastmod(ll a,ll b)
{
    ll ans=1;
    a=a%mod;
    if(a==0)
        return 0;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%mod;
        b=b>>1;
        a=(a*a)%mod;
    }
    return ans%mod;
}
ll fermat(ll a)
{
    return fastmod(a,mod-2)%mod;
}


vector<ll> fact(siz);
vector<ll> invfact(siz);
void f()
{
    fact[0]=fact[1]=invfact[0]=invfact[1]=1;
    for(ll i=2;i<siz;i++)
    {
        fact[i]=(i*fact[i-1])%mod;
        invfact[i]=(invfact[i-1]*fermat(i))%mod;
    }
}
ll choose(ll n,ll r)
{
    ll ans=fact[n]%mod;
    ans=(ans*invfact[n-r])%mod;
    ans=(ans*invfact[r])%mod;
    return ans%mod;
}

int main()
{
    fast;
    ll a,b,c,d,p,n,m,t,h,k,q,x,val,y;
    cin>>n;
    ll ans=0;
    set<ll> s;
    for(ll i=2;i<=(ll)sqrt(n);i++)
    {
        val=i;
        while(val<=n)
        {
            val*=i;
            if(val<=n)
                s.insert(val);
        }
    }
   
    cout<<n-s.size();
    

}


/*cin>>t;
    map<ll,ll> mp;
    while(t--)
    {
        cin>>n>>m>>k;
        cin>>p;
        set<ll> s;
        for(ll i=0;i<p;i++)
        {
            cin>>a;
            s.insert(a)
        }

    }
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    ll N;
    cin >> N;
    unordered_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;
}