#include <iostream>
using namespace std;
using ll = long long;
ll number_ab(ll a, ll n);
bool fakeprime(ll n);
int main()
{
    ll n, ans;
    cin >> n;
    ans = n;
    for (ll i = 0; i*i <= n; i++) {
        if (fakeprime(i)) {
            ans -= number_ab(i, n);
        }
    }
    cout << ans << endl;
    return 0;
}
ll number_ab(ll a, ll n)
{
    if (a > n) return -1;
    ll k = a, b = 0;
    while (true) {
        k *= a;
        if (k <= n) b++;
        else        break;
    }
    return b;
}
bool fakeprime(ll n)
{
    if (n <= 1) return false;
    ll k;
    for (ll i = 2; i*i <= n; i++) {
        k = n;
        while (k % i == 0) {
            k /= i;
        }
        if (k == 1) return false;
    }
    return true;
}
#include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <random>
#include <numeric>
#include <cmath>
#include <complex>
#include <stack>
#include <memory>
#include <cstdio>
#include <iomanip>

using namespace std;
using ll = long long;

#define FOR(i,a,b)  for(ll i=ll(a); i<ll(b); i++)//  a<=i<b i++ のforの開始
#define FOR_(i,b,a) for(ll i=ll(b); ll(a)<i; --i)// b =>i>a i-- のforの開始
#define EACH(e,a) for(auto &(e):(a))//集合aの各要素eを当たる forの開始
#define FIND(e,a,i) vector<ll>::iterator itr=find((a).begin(),(a).end(),e);\
 if(itr!=(a).end()){i=itr-(a).begin();} else{i=-1;}//vector aの中に要素eはあるのかあるならindexをiに，なければiは-1
#define MAX(a,i) vector<ll>::iterator itr0=max_element((a).begin(),(a).end());\
 i=(ll)(itr0-(a).begin());// vector<ll>の最大値の足をiに返す
#define MIN(a,i) vector<ll>::iterator itr1=min_element((a).begin(),(a).end());\
 i=(ll)(itr1-(a).begin());// vector<ll>の最小値の足をiに返す
#define ERASE(a,i) (a).erase((a).begin()+i);//iは0始まり
#define ERASES(a,i,j) (a).erase((a).begin()+i,(a).begin()+j);//i,jは0始まり i<= u <jの範囲を消す i!=j
#define SORT(a)  sort(begin(a),end(a))//小さい順にsort 1,2,3
#define SORT_(a) sort(begin(a),end(a),greater<ll>{})//大きい順にsort 5,4,3
#define OUT(s) cout<<(s)<<endl
#define OUT2(s0,s1) cout<<(s0)<<" "<<(s1)<<endl
#define OUT3(s0,s1,s2) cout<<(s0)<<" "<<(s1)<<" "<<(s2)<<endl
#define OUT4(s0,s1,s2,s3) cout<<(s0)<<" "<<(s1)<<" "<<(s2)<<" "<<(s3)<<endl
#define OUT5(s0,s1,s2,s3,s4) cout<<(s0)<<" "<<(s1)<<" "<<(s2)<<" "<<(s3)<<" "<<(s4)<<endl
#define OUTV(a) FOR(i,0,(a).size()){cout<<a[i]<<" ";} cout<<""<<endl;
#define OUTVV(a) FOR(i,0,(a).size()){FOR(j,0,(a[i]).size()){cout<<a[i][j]<<" ";}cout<<" "<<endl;}

// 20210515 ABCに向けて頑張ってみる



void une()
{
    ll N;
    cin >> N;
    //N = 8;
    //N = 100000;
    if(N <= 3)
    {
        OUT(N);
        return;
    }


    ll n0,n;
    n0 = sqrt(N)+1;
    double s0,s1;
    set<ll> ss;

    FOR(i,2,n0)
    {
        s0 = (double)log(N);
        s1 = (double)log(i);
        n = (ll)(s0/s1);
        if(2<=n)// i^1を消す
        {
            FOR(j,2,n+1)
            {
                ss.insert(pow(i,j));
                //OUT(pow(i,j));
            }
        }
        else
        {
            break;
        }
    }

    OUT(N-ss.size());



}



int main()
{
    une();


    return 0;
}
