#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const ll Mod = 998244353;
const int MAX = 510000;
const double PI = 3.14159265358979;
const vector<int> dx = {1, 0};
const vector<int> dy = {0, 1};

int main() {
    ll N;
    cin >> N;
    set<ll> PP; // 10^10以下の累乗数
    for (ll i=2; i<=100000; i++) {
        for (int j=2; (ll)pow(i, j)<=(ll)pow(10, 10); j++) {
            PP.insert((ll)pow(i, j));
        }
    }
    ll res = 0;
    for (auto v: PP) {
        if (v<=N) res++;
    }
    cout << N-res << endl;
    return 0;
}
#include<iostream>
using namespace std;
int main()
{
	int i,num=0;
	char s[12];
	for(i=0;i<12;i++)
	{
		cin>>s[i];
	}
	for(i=3;i<12;i++)
	{
		if(s[i-3]=='Z'&&s[i-2]=='O'&&s[i-1]=='N'&&s[i]=='e')
			num++;
	}
	cout<<num;
	return 0;
}
