object Main extends App{ val n = readInt val b = n.toBinaryString val res = if(b.count(_ == '1') <= 1) b.length - 1 else b.length println(res) }