#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
using namespace std;

#define rep(i, l, r) for(int i=(l), i##_end_=(r); i<=i##_end_; ++i)
#define drep(i, l, r) for(int i=(l), i##_end_=(r); i>=i##_end_; --i)
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
#define Endl putchar('\n')
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<class T>inline T fab(T x){ return x<0? -x: x; }
template<class T>inline T readin(T x){
    x=0; int f=0; char c;
    while((c=getchar())<'0' || '9'<c) if(c=='-') f=1;
    for(x=(c^48); '0'<=(c=getchar()) && c<='9'; x=(x<<1)+(x<<3)+(c^48));
    return f? -x: x;
}

const int maxn=1e5;

ll n;

int vis[maxn+5];

signed main(){
    n=readin(1ll);
    ll ans=0;
    vis[1]=1;
    for(int i=2; 1ll*i*i<=n; ++i) if(!vis[i]){
        vis[i]=1;
        for(ll cur=1ll*i*i; cur<=n; cur=1ll*cur*i){
            if(cur<=maxn) vis[cur]=1;
            ++ans;
        }
    }
    printf("%lld\n", n-ans);
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5;
const ll mod = 998244353;

/*  I should look for
	* if WA, check the code from very top until bottom.
	* always write observations if problem is hard.
	* keep thought process clear.
	* special cases (n=1?)
	* stay organized.
	* DON'T GET STUCK ON ONE APPROACH
*/

int main()
{
	ios_base :: sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin >> n;
	set <ll> s;
	for(ll i = 2;i <= sqrt(n);i++)
	{
		ll x = i;
		while((x * i) <= n)
			s.insert(x * i), x = x * i;
	}
	cout << n - s.size();
	return 0;
}
