#include<bits/stdc++.h>
#define pb push_back
#define ll long long 
#define f first
#define s second
using namespace std ;
int main(){
	ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
 	int n ; 
 	cin >> n ; 
 	ll ans = 0 ; 
 	int t = 0 ; 
 	while( ans < n ) {
 		t ++ ; 
 		ans = ans + t ; 
	 }
	 cout << t << endl ; 
	
}
#include<bits/stdc++.h>

using namespace std;

#define PB push_back
#define fo(i0, n) for(i=0;i<n;i++)
#define fo(i1, n) for(i=1;i<=n;i++)

typedef long long ll;
typedef unsigned long long ull;

ull GCD(ull x,ull y){if(y==0) return x;else return GCD(y,x%y);}
ull LCM(ull a,ull b){return (a*b/(GCD(a,b)));}
bool PRIME(int p){if (p<=1)return false;if (p<=3)return true;if(p%2==0||p%3==0) return false;for(int i=5;p>=i*i;i=i+6){if(p%i==0||p%(i+2)==0) return false;}return true;}

int main()
{
    ll a,b,c,d,e,t,i,j,k,l,sum=0,ans=0,x,y,z=-1,m,n;
    string S,T,U;
    cin>>a;
    unordered_set<ll>A;
    for(i=2;i*i<=a;i++)
    {
        b=i*i;
        while(b<=a)
        {
            A.insert(b);
            b*=i;
        }
    }
    cout<<a-A.size()<<endl;

    return 0;
}


