include<stdio.h>
include<math.h>
int main()
{
long h;
while(scanf("%ld",&h)!=EOF)
{
for(long i=sqrt(h);i>0;i--) { if(h==1) { printf("0\n"); } if((i*i+i)<=h) { printf("%ld\n",i); break; } } } return 0;
}
int main()
{
long h;
while(scanf("%ld",&h)!=EOF)
{
for(long i=sqrt(h);i>0;i--) { if(h==1) { printf("0\n"); } if((i*i+i)<=h) { printf("%ld\n",i); break; } } } return 0;
}