fun main(args: Array) { val (n,k) = readLine()!!.split(" ").map { it.toInt() } val s = readLine()!! val list = mutableListOf() s.indices.forEach { list.add(Kakko(it, s[it] == '(')) } var ans = -1 while (list.isNotEmpty()) { val idx = list.indexOfLast { it.isLeft } val right = list[idx + 1] val left = list[idx] if(right.index == k - 1) { ans = left.index break } else if(left.index == k - 1) { ans = right.index break } list.removeAt(idx + 1) list.removeAt(idx) } println(ans + 1) } class Kakko(val index:Int, val isLeft:Boolean)