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

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

    return 0;
}

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

// 約数列挙
vector<long long> calc_divisor(long long n) {
    vector<long long> res;
    for (long long i = 1LL; i * i <= n; ++i) {
        if (n % i == 0) {
            res.push_back(i);
            long long j = n / i;
            if (j != i) res.push_back(j);
        }
    }
    sort(res.begin(), res.end());
    return res;
}

int main() {

	ll n; cin >> n;
    vector<long long> div = calc_divisor(n);
    for (int i = 0; i < div.size(); i++) {
        cout << div[i] << endl;
    }    	
	return 0;
}