import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { int N = scan.nextInt(); int K = scan.nextInt(); char S[] = scan.next().toCharArray(); int count = 0; if(S[K-1] == '(') { for(int i=K-1; i=0; i--) { if(S[i] == ')') { count++; } else { count--; if(count == 0) { System.out.println(i+1); break; } } } } } } }