#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
#define Rep(i,x,n) for(i=x;i<=n;i++)
#define all(v) v.begin(),v.end()
#define p_b push_back
#define fr first
#define sc second
#define m_p make_pair
#define zero(a) memset(a,0,sizeof(a))
#define setp setprecision
typedef long long ll;
typedef long double ld;
const ll INF=0x3f3f3f3f;
const ll mod=1000000007;
const ld eps=1e-14;
ll i,j;

ll n;
set<ll> st;

int check(int x){
	int ret=0;
	for(int j=2;j<=33;j++){
		ll num=pow(i,j);
		if(num>n) break;
		//cout<<num<<' ';
		if(num<=n&&st.find(num)==st.end()&&num>0){
			ret++;
			st.insert(num);
		}
	}
	return ret;
} 

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	cin>>n;
	ll ans=n;
	for(i=2;i*i<=n;i++){
		ans-=check(i);
	}
	//ans=n-ans;
	cout<<ans<<endl;
	return 0;
}


#include <cmath>
#include <iostream>
#include <unordered_set>
using namespace std;

int main()
{
  using ll = long long;
  ll N;
  cin >> N;
  const ll r = sqrt(N);
  unordered_set<ll> n;
  for (ll i = 2; i <= r; ++i)
  {
    ll ab = i*i;
    for (; ab <= N; ab *= i)
      n.insert(ab);
  }
  cout << N - n.size() << endl;
  return 0;
}
