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


#define ull unsigned long long
#define ll long long
#define ld long double
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define For(x,a,b) if(a!=b){icdc=(b-a)/abs(b-a);}else{icdc=1;}for(int x=(a);x!=(b+icdc);x+=icdc)
#define forp(x,a,b) if(b-a!=0){icdc=(b-a)/abs(b-a);}else{icdc=1;};for(int x=(a);x!=(b);x+=icdc)
#define FOR(x,n) for(int x=0;x<(n);x++)
int icdc;

//Frequently Used Variables
ull M=1e9+7;
ll b;
//ll A[100005];
ll maxv=-1e18,minv=1e18,LLINF=1e18,INF=1e9;
string s;

map<long long,int> mp;
vector<ll> v;

#define co cout<<
#define kj <<" "<<
#define ml <<'\n';

void solve(){
	cin>>b;
	//cout<<b<<endl;
	sort(v.begin(), v.end());
	//ll js=upper_bound(v.begin(), v.end(),b)-v.begin();
	for(ll i=0;i<(int)v.size();i++){
		//co "vi" kj b kj v[i] ml
		if(b<v[i]){
			cout<<b-i<<endl;
			return;
		}
	}
	cout<<b-v.size()<<endl;

}

void prekomput(){
	ll j;
	//cout<<"aman"<<endl;
	for(ll i=2;i<=1e5;i++){
		//cout<<"I"<<i<<endl;
		j=i*i;
		while(j<=1e10+1){
			if(mp[j]==0){
				mp[j]=1;
				v.push_back(j);
				//cout<<"vs"<<v.size()<<"  ";
				//cout<<j<<endl;
			}
			j=j*i;
		}
	}
	//cout<<"aman"<<endl;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(0);
	//freopen("input.txt", "r", stdin);
 	//freopen("output.txt", "w", stdout);
 	prekomput();
 	solve();
}
/*

*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    ll n;cin>>n;
    unordered_set<ll> s;
    for(ll i=2;i*i<=n;i++){
        ll k=i*i;
        while(k<=n){
            s.insert(k);
            k=k*i;
        }
    }
    cout<<n-s.size();
}