
import java.util.Scanner

/**
 * Created by sonetsuyoshi on 2015/12/16.
 */
object Main extends App {
  val scanner = new Scanner(System.in)
  val n = scanner.nextInt

  val tn = n * 2

  var m = ((-1 + math.sqrt(1 + 9 * n)) / 2).toInt
  while(m * (m + 1) < tn) {
    m += 1
  }
  println(m)
}