#include<bits/stdc++.h>
using namespace std;
#define il inline
#define ri register int
#define ll long long
#define ui unsigned int
il ll read(){
    bool f=true;ll x=0;
    register char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') f=false;ch=getchar();}
    while(ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
    if(f) return x;
    return ~(--x);
}
il int read(char *s){
    int len=0;
    register char ch=getchar();
    while(ch==' '||ch=='\n') ch=getchar();
    while(ch!=' '&&ch!='\n'&&ch!=EOF) s[++len]=ch,ch=getchar();
    return len;
}
il void write(const ll &x){if(x>9) write(x/10);putchar(x%10+'0');}
il void print(const ll &x) {x<0?putchar('-'),write(~(x-1)):write(x);putchar('\n');}
il ll max(const ll &a,const ll &b){return a>b?a:b;}
il ll min(const ll &a,const ll &b){return a<b?a:b;}
ll n,ans;
struct hmap{
    static const int P=2e6+3,M=3e6+10;
    int hed[M],nxt[M],cnt;ll val[M];ll as[M];
    bool count(ll x){
        int c=hed[x%P];
        while(c){
            if(val[c]==x) return 1;
            c=nxt[c];
        }return 0;
    }
    ll& operator [](ll x){
        int c=hed[x%P];
        while(c){
            if(val[c]==x) return as[c];
            c=nxt[c];
        }
        ++cnt;val[cnt]=x;nxt[cnt]=hed[x%P];hed[x%P]=cnt;
        return as[cnt];
    }
    int size(){return cnt;}
}M;
int main(){
    ans=n=read();
    for(ll i=2;i*i<=n;++i){
        ll res=i*i;
        while(res<=n){
            if(!M[res]) M[res]=1,--ans;
            res*=i;
        }
    }
    print(ans);
    return 0;
}
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include <bits/stdc++.h>
#define inf 0x7fffffff
#define ll long long
#define int long long
//#define double long double
#define eps 1e-8
//#define mod 1e9+7
using namespace std;
const int mod=1e9+7;
const int M=2e3+5;
const int N=2*1e5+5;//?????????? 4e8
int n,m;
int prime[N],v[N];
int ans;
map < int , bool > mp;
signed main()
{
//	ios::sync_with_stdio(false);
	cin>>n;
	m=sqrt(n);
	for(int i=1;i<=m;i++)
	{
		if(mp[i])  continue;
		int j=i;
		mp[i]=1;
		if(i==1)  continue;
		while(j<=n)
		{
			j=i*j;
			if(j>n)  break;
			ans++;
			mp[j]=1;
		}
	}
	cout<<n-ans;
	return 0;
}