#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vc = vector<T>;
template<class T> using vvc = vc<vc<T>>;
template<class T> using vvvc = vc<vvc<T>>;
template<class T> using vvvvc = vvc<vvc<T>>;
template<class T> using PQ = priority_queue<T>;
template<class T> using invPQ = priority_queue<T, vector<T>, greater<T>>;
using IP = pair<int, int>;
using LP = pair<ll, ll>;
#define mp make_pair
#define pb push_back
#define all(x) begin(x), end(x)
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define rep3(i, m, n) for (int i = (m); (i) < (int)(n); i++)
#define repr(i, n) for (int i = n; (i) >= (int)(n); i--)
#define rep3r(i, m, n) for (int i = (n); (i) >= (int)(m); i--)
template<class T> inline bool chmax(T & a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T & a, T b) { if (a > b) { a = b; return 1; } return 0; }
constexpr int INF = 1070000000;
constexpr long long LINF = 4611686015206162431;
template <class T> void checkarray(T &v) { for (auto &a : v) cout << a << " "; cout << endl; }

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    ll N;
    cin >> N;

    ll ans = N;
    int ssize = sqrtl(N);
    vc<bool> seen(ssize+1);
    for (ll i = 2; i*i <= N; i++) {
        if (seen[i]) continue;
        ll n = i;
        while (n < N) {
            n *= i;
            if (n <= N) {
                ans--;
                if (n <= ssize) seen[n] = true;
            }
        }
    }

    cout << ans << endl;
}
#include<bits/stdc++.h>
using namespace std;

int main(){
  long long n; cin >> n;
  set<long long> s;
  for(long long i=2;i*i<=n;i++){
    long long x=i*i;
    while(x<=n){
      s.insert(x);
      x*=i;
    }
  }
  
  cout << n-s.size() << endl;
}