import Control.Applicative main = do [n, k] <- map read . words <$> getLine s <- getLine let f [] _ _ = undefined f (c:s) xs@(y:ys) i | i == k && c == ')'= y | y == k && c == ')' = i f ('(':s) xs i = f s (i:xs) (i+1) f (')':s) (_:ys) i = f s ys (i+1) in print $ f s [] 1