#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define ul unsigned long long
#define ui unsigned int
#define ri register int
#define pb push_back
#define mp make_pair
char p[30]={'0','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
inline ll rd(){
	ll x=0,flag=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') flag=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
	return x*flag;
}
/*
int wl,x,y,head[];
struct node{
	int nxt,to;
}star[];
inline void add(int from,int to){
	wl++;
	star[wl].to=to;
	star[wl].nxt=head[from];
	head[from]=wl;
}*/
inline int lowbit(int x){return x & ( - x ) ;}
ll n;
map<ll,int>vis;
int main()
{
	n=rd();
	ll lim=sqrt(n),ans=0;
	for(ll i=2;i<=lim;++i){
	    ll tmp=i;
        for(ri j=2;;++j){
            tmp*=i;//cout<<i<<" "<<tmp<<endl;
            if(tmp>n) break;
            if(vis.find(tmp)==vis.end()) vis[tmp]=1,ans++;
        }
    }
    cout<<n-ans;
    return 0;
}

#include <iostream>
#define int long long
using namespace std;

const int N = 100000 + 7;

int pd[N], prime[N];
int cnt;
inline void diprime()
{
    pd[0] = pd[1] = 1;
    for(int i=2; i<=N-7; i++)
    {
        if(!pd[i]) prime[++cnt]=i;
        for(int j=1; j<=cnt; j++)
        {
            if(prime[j] * i > N-7) break;
            pd[prime[j] * i] = 1;
            if(i%prime[j] == 0) break;
        }
    }
    return ;
}

int n, ans;

bool nmsl[100007];

inline void doit(int x)
{
    int now = x;
    for(int i=2; (now*=x)<=n; i++) {
        // now *= x;
        // if(pd[i]) continue;
        if(now <= 100000) nmsl[now] = 1;
        // cout << x << ' ' << i << ' ' << now << ' ' << nmsl[now] << '\n';
        ans++;
    }
    return ;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    // diprime();

    cin >> n;
    for(int i=2; i*i<=n; i++) {
        if(nmsl[i]) continue;
        doit(i);
    }
    cout << n - ans << '\n';
}