let inpt = readLine()!.split(separator: " ").map({Int($0)!}) let target = inpt[1] let str = readLine()!.map(Character.init) var stack = [Int]() var moji = 0 for i in str { moji+=1 if(i=="(") { stack.insert(moji, at: 0) } else { let tmp = stack.removeFirst() if(tmp == target) { print(moji) break } } }