#include "bits/stdc++.h"
#include "random"
#include <unistd.h>

using namespace std;

#define ll long long
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vi>
#define pi  pair<int,int>
#define mp  make_pair
#define pb  push_back
#define MOD int(1e9) + 7
#define PAI  3.1415926535
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define chmax(x, y) x = max(x,y)
#define chmin(x, y) x = min(x,y)
#define pr(x) cout << x << endl
#define Endl endl
#define rep(i, n) for(int i = 0 ; i < n; ++i)

const int dx2[4] = {0,1,0,1};
const int dy2[4] = {0,0,1,1};
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
const int ddx[8] = {-1,0,1,-1,1,-1,0,1};
const int ddy[8] = {-1,-1,-1,0,0,1,1,1};
const int inf = 99999999;
const ll linf = 1LL << 62;

ll gcd(ll a,ll b){
  if(a < b)swap(a , b);
  if(a % b != 0) return(gcd(b, a%b));
  return b;
}

ll lcm(ll a,ll b){
  if(a < b)swap(a , b);
  return (a / gcd(a , b)) * b;
}

int Uniform_Random(int a, int b){ // (a <= x <= b)

  random_device rd;
  mt19937 mt(rd());
  
  uniform_int_distribution<int> rv1(a, b);
  return rv1(mt); 
}


int main(){
  
  ll N; cin >> N;
  ll ans = N;
  set<ll> st;
  for(ll i = 2; i <= sqrt(N); ++i){
    ll cnt = 2;
    if(st.find(i) == st.end()){
      while(pow(i, cnt) <= N){
        st.insert(pow(i, cnt));
        ans --;
        cnt ++;
      }
    }
  }

  cout << ans << endl;

  return 0;
}
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define dbg(x) cout<< #x <<" "<<x<<"\n";
#define pii pair<ll,ll>
using namespace std;



void solve(){
    ll n;
    cin>>n;
    unordered_set<ll> s;
    for(ll i=2; i*i<=n; ++i){
        ll x = i*i;
        while(x<=n){
            s.insert(x);
            x*=i;
        }
    }
    cout<<n-s.size()<<"\n";
}


int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t,tt=0;
    // cin>>t;
    t=1;
    while(t--){
        //cout<<"Case #"<<++tt<<": ";
        solve();
    }
}


