/* High school math problem. Pitfall when using an int. Should be easy. */ import kotlin.math.sqrt fun main() { println(((-1 + sqrt(1.0 + 8 * readln().toLong())) / 2).toLong()) } /* h(h+1)/2 <= n h^2+h -2n = 0 */