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

using ll=long long;
ll mod=1000000007;

int main(){
    ll N;
    cin >> N;
    set<ll> P;
    for(ll a=2;a*a<=N;a++){
        ll j=a*a;
        while(j<=N){
            P.insert(j);
            j*=a;
        }
    }
    cout << N-P.size() << endl;
}
#include "bits/stdc++.h"
using namespace std;

#define int long long
#define pb push_back
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

void solve() {	
	int n;
	cin >> n;

	int ans = n;
	set<int> s;
	for(int i=2 ; i*i<=n ; i++){
		if(s.count(i)){
			continue;
		}
		int cnt = 0;
		int x = 1;
		while(x * i <= n){
			cnt++;
			x *= i;
			s.insert(x);
		}
		ans -= max(0LL, cnt - 1);
	}
	cout << ans << "\n";
}

int32_t main() {
    fast;
    int t = 1;
    // cin >> t;
    while (t--)  solve();
}