#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    ll N;
    cin >> N;

    ll M = floor(sqrt(N));

    vector<bool> isExp(M+1, true);
    ll cnt = 0;
    isExp[0] = false;
    for (ll i=2; i<=M; i++) {
        if (isExp[i]) {
            for (ll j=2; pow(i,j)<=N; j++) {
                cnt++;
                if (pow(i,j)<=M) {
                    isExp[pow(i,j)] = false;
                }
            }
        }
    }

    cout << N - cnt << endl;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

