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

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;
        }
    }

    ll ans = N - s.size();
    cout << ans << endl;
}

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

int main()
{
    long long n,i,m,ans;
    cin>>n;
    vector<long long> a;
    i=2;
    ans=0;
    while (i*i<=n)
    {
        m=pow(i,2);
        while (m<=n)
        {
            a.push_back(m);
            m*=i;
        }
        i++;
    }
    sort(a.begin(),a.end());
    /* for (i = 0; i < a.size(); i++) cout<<a[i]<<" ";
    cout<<endl; */
    if (a.size()>=1) ans=1;
    for (i = 1; i < a.size(); i++)
    {
        if (a[i]!=a[i-1]) ans++;
    }
    cout<<n-ans<<endl;
}