package main import ( "fmt" ) func main() { var n int fmt.Scan(&n) fmt.Println(countHit(n-1, 1, 0)) } func countHit(need int, current int, hitMemo int) int { if need <= 0 { return hitMemo } if need <= current { return hitMemo + 1 } return countHit(need-current, 2*current, hitMemo+1) }