#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<sstream>
#include<cstring>
#include<cstdio>
#include<string>
#include<deque>
#include<cmath>
#include<queue>
#include<set>
#include<map>

using namespace std;

std::set<long long> numSet;


bool isPrime(long long num) {
	if (num == 2)
		return true;
	if (num % 2 == 0)
		return false;
	
	int d = 3;
	while ((d * d) <= num) {
		if (num % d == 0)
			return false;
		d = d + 2;
	}
	
	return true;
}

int main(void)
{
	long long n;
	long long left;
	
	scanf("%lld", &n);
	left = n;
	
	long long p;
	p = 2;
	while ((p * p) <= n) {
//		if (isPrime(p) == false) {
//			p++;
//			continue;
//		}
		if (numSet.find(p) != numSet.end()) {
			p++;
			continue;
		}
		
		long long curNum = p * p;

		while (curNum <= n) {
			numSet.insert(curNum);
			left--;
			curNum = curNum * p;
		}
		p++;
	}
	
	
	printf("%lld\n", left);
	
	return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <functional>
#include <cmath>
#include <unordered_set>
using namespace std;

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