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

#define   FASTIO  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   tr(it, a)   for(auto it=a.begin();it!=a.end();it++)
#define   dbg(x,y) cout<<(x)<<" -->  "<<(y)<<endl
#define   all(a) (a).begin(), (a).end()
#define   rep(i,a,b)  for(int  i=a;i<b;i++)
#define   int  long long
#define   pii pair<int,int>
#define   vi vector<int >
#define   pb push_back
#define   F first
#define   S second
#define   endl  "\n"


const int  N = 1e4 + 3;
const int  inf = 1e18 + 3;
const int  ninf = -1e9;
const int  mod = 1e9 + 7;
//--------------------------------------------------------------//

void solve()
{
    int n;
    cin >> n;

    int x = ceil(sqrt(n));
    int cnt = 0;
    map<int, int>mp;

    for (int i = 2; i <= x; i++)
    {
        int j = i;
        while (i * j <= n)
        {
            if (mp.find(i * j) == mp.end())
            {
                cnt++;
                mp[i * j] = 1;
            }
            j = j * i;
        }
    }
    cout << n - cnt;


}

signed main()
{

#ifndef ONLINE_JUDGE
    freopen("inputf.in.txt", "r", stdin);
    freopen("outputf.in.txt", "w", stdout);
#endif

    FASTIO;
    int T = 1;
    //preProcess();
    //cin >> T;

    for (int t = 1; t <= T; t++)
    {
        solve();
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){ 
  long long int n;
  cin >>n;
  unordered_set<long long int> s;
    for(long long int i=2;i*i <= n;i++){
        long long x = i * i;
        
        while (x <= n){
          s.insert(x);
          x *= i;
        }
    }

    cout << n - s.size() <<endl;

    return 0;
}