#include <stdint.h>
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp>

#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);//cout.precision(dbl::max_digits10);
#define pb(x) push_back(x)
#define mod 1000000007ll //998244353ll
#define vi vector<int>
#define v(x) vector< x >
#define lld long double
#define pii pair<int, int>
#define ff first
#define ss second 
#define endl "\n" 
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)   
#define repe(i,x,y) for(int i=x; i<=y; i++)    
#define fill(a,b) memset(a, b, sizeof(a))
#define setbits(x) __builtin_popcountll(x)
#define show(x) cout<<x<<"\n" 
#define print2d(dp,n,m) for(int i=0;i<=n;i++){for(int j=0;j<=m;j++)cout<<dp[i][j]<<" ";cout<<"\n";}

typedef std::numeric_limits< double > dbl;
using namespace __gnu_pbds;
using namespace std;
lld pi=3.1415926535897932;

/*-----------------------------------------------------------*/

int solve(){
	int n;
	cin>>n;
	
	map<int,int> mp;
	for(int i=2;i*i<=n;i++){
		if(!mp.count(i)){
			for(int j=i*i;j<=n;j*=i)
				mp[j]=1;
		}
	}
	return n-mp.size();
}

int32_t main(){
	IOS
	
	int t=1;
	
	while(t--)
	cout<<solve()<<endl;
	
	return 0;
}
#include <bits/stdc++.h>
#define poi 200100
#define int long long
using namespace std;
typedef long long ll;
typedef double db;
set<int> s;
inline int re()
{
    char c = getchar();
    int x = 0, k = 1;
    while (c < '0' || c > '9')
    {
        if (c == '-')
            k = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9')
        x = (x << 1) + (x << 3) + c - '0', c = getchar();
    return k * x;
}
void wr(int x)
{
    if (x < 0)
        putchar('-'), x = -x;
    if (x > 9)
        wr(x / 10);
    putchar(x % 10 + '0');
}
inline int ksm(int x, int y)
{
    int ans = 1;
    for (; y; y >>= 1)
    {
        if (y & 1)
            ans = (ans * x);
        x = (x * x);
    }
    return ans;
}
signed main()
{
    int n = re(), ans = 0;
    for (int a = 2;; a++)
    {
        bool canEnter = 0;
        for (int b = 2, num; (num = ksm(a, b)) <= n; b++)
        {
            canEnter = 1;
            if (s.find(num) == s.end())
                ans++, s.insert(num);
        }
        if (!canEnter)
            break;
    }
    wr(n - ans);
    return 0;
}