#include<bits/stdc++.h>
using namespace std;
using ll=int64_t;
#define rep1(i,n) for(ll i=0;i<n;i++)
#define rep2(i,x,n) for(ll i=x;i<n;i++)
int main(){
    ll N;cin>>N;
    ll counter=0;
    vector<ll>V;
    for(ll i=2;i<=1e5;i++){
        for(ll j=2;j<=34;j++){
            ll number=pow(i,j);
            if(number<=N){
                ll flag=1;
                for(auto x:V){
                    if(number==x){
                        flag=0;
                        break;
                    }
                }
                if(flag==1){
                    V.push_back(number);
                }
            }else{
                break;
            }
        }
    }
    cout<<N-V.size()<<endl;
}

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

//#define int long long
typedef long long ll;
//const int INF = 2e9;
//const ll INF = 9e18;

void solve(){
    ll N;
    cin >> N;
    set<ll> st;
    ll ans = 0;
    for (ll i=2;i*i<=N;i++){
        if (st.find(i)!=st.end()) continue;
        for (ll j=i*i;j<=N;j*=i){
            if (st.find(j)==st.end()) {
                ans++;
                st.insert(j);
            }
        }
    }
    cout << N - ans << "\n";
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(9);
    solve();
    return 0;
}