import java.util.Scanner; import java.util.Stack; public class No22 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt() , K = s.nextInt(); s.nextLine(); String St = s.nextLine(); s.close(); Stack stack = new Stack<>(); for(int i = 0;i < N;i++){ if(St.charAt(i) == '('){ stack.push(i); }else{ if(i + 1 == K){ System.out.println(stack.pop() + 1); break; }else if(stack.peek() + 1 == K){ System.out.println(i + 1); break; }else{ stack.pop(); } } } } }