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

int main() {
  int64_t N;
  cin >> N;
  set<int64_t> check;
  int64_t ans = 0;
  
  for (int i = 2; i <= log2(N); i++){
    int a = 2;
    while(true){
      if(pow(a, i) > N){
        break;
      }
      check.insert(pow(a,i));
      a++;
    }
  }
  
  ans = N - check.size();
  
  cout << ans <<endl;
}
#include<bits/stdc++.h> 
using namespace std; 

#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int, int>

#define qi queue<int>
#define sti stack<int>
#define pqi priority_queue<int>
#define pqii priority_queue<pair<int, int>>

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define nl endl

#define INF (int)1e9
#define MOD 1000000007



int main() 
{ 
   ios_base::sync_with_stdio(false);cin.tie(NULL); 

   #ifndef ONLINE_JUDGE 
   freopen("input.txt", "r", stdin); 
   freopen("error.txt", "w", stderr); 
   freopen("output.txt", "w", stdout); 
   #endif 

   int case_t=1; 
   // cin>>case_t; // Multiple testcases


   while(case_t--) 
   { 
      ll n;
      cin>>n;
      ll n1 = (int)sqrt(n);
      // cout<<n1;
      ll a[n1+5];
      memset(a, 0, sizeof(a));
      // p = 2;
      ll ans = n;
      ll p;
      for(ll p=2; p*p<=n; p++){
         if (a[p] == 1) continue;
         ll x = p*p;
         while(x<=n){
            if(x<=n1 && a[x]==1) ;
            else if (x<=n1){
               a[x]=1;
               ans--;
            }
            else ans--;
            x = x*p;
         }
      }

      // ans += n-p;
      cout<<ans;


      cout<<"\n";
   } 

   cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl; 
   return 0; 
} 
