#include<iostream>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<cstdio>
#include<cmath>
#include<bits/stdc++.h>

using namespace std;
using ll = long long;
const long long INF = 1LL<<60;

const ll di[] = {-1, 0, 1, 0};
const ll dj[] = {0, -1, 0, 1};

vector<ll> load[100005];

typedef pair<ll,ll> Pair;

int main(){

  	ll N;
	unordered_set<ll> p;
  
  	cin >> N;
  
  	ll cnt = 0;

   	for(ll i = 2;i*i <=N;++i){

      for(ll j =i*i;j<=N;j*=i){
        p.insert(j); 
      }
      
    }
  /*  
  	for(ll i = 2;i*i <=N;++i){

      ll ok = 1;
      ll ng = 34;
      
      while(ng-ok != 1){
        
        ll wj = (ok+ng)/2;
        
        if(pow(i,wj)<=N){
         ok = wj; 
        }
        else{
         ng = wj; 
        }
        
      }
      
      cout << i <<" " << ok << endl;
      cnt+=(ok-1);
    }
  
  	cout << N - cnt << endl;
*/  
  	cout << N - p.size() << endl;

  return 0;
  
}
#include <bits/stdc++.h>
#define REP(i, nn ) for(int i = 0 ; i < (int) nn; i++)
#define REPS(i, ss, nn ) for(int i = ss ; i < (int) nn; i++)
#define REV(i, ss, nn ) for(int i = ss ; i >= nn; i--)
#define deb(x) std::cout << #x << " " << x << endl;
#define debl(x) std::cout << #x << " " << x << " ";
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
namespace std{
    template<class Fun>
    class y_combinator_result{
        Fun fun_;
        public:
            template<class T>
            explicit y_combinator_result(T &&fun) : fun_(std::forward<T>(fun)){}
            template<class ...Args>
            decltype(auto) operator()(Args&&...args){
                return fun_(std::ref(*this), std::forward<Args>(args)...);
            }
    };
    template<class Fun>
    decltype(auto) y_combinator(Fun && fun){
        return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
    }
};
template<typename T>
bool umax(T& a, T b){
    bool ret = a < b;
    if(ret) a = b;
    return ret;
}
template<typename T>
bool umin(T& a, T b){
    bool ret = a > b;
    if(ret) a = b;
    return ret;
}
struct edge{
    int to; ll cost;
    int from;
    edge(){ edge(0,0);}
    edge(int to_, ll cost_) : to(to_), cost(cost_){}
    edge(int to_, int from_, ll cost_) : to(to_), cost(cost_), from(from_){}
};

template<typename... T>
void read(T& ... a){
    ((cin >> a),...);
}

template<typename... T>
void write(T... a){
    ((cout << a),...);
}


template<typename T>
vector<T> read_array(int sz){
    vector<T> ret(sz);
    for(auto & x : ret) cin >> x;
    return ret;
}

void solve(){
    ll n;
    read(n);
    set<ll> st;
    for(ll k = 2; k * k <= n; k++){
        ll a = k * k;
        while(a <= n){
            st.insert(a);
            a *= k;
        }
    }
    ll ans = n - st.size();
    write(ans, "\n");
}

int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/
    int T = 1;
    // cin >> T;
    while(T--)
        solve();
    return 0;
}

