import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val ans = (1 to n).scan(0)(_ + _).tail.takeWhile(_ < n).length + 1
    println(ans)
  }
}
