import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner s=new Scanner(System.in);
long h=s.nextLong();
// long w=(long)(Math.sqrt(4*h+1)-1)/2;
// System.out.println(w);
for(long i=(long)Math.sqrt(h);i>=0;i--){
if(i * (i + 1) <= h)
{
System.out.println(i);
break;
}
}
}
}