import java.util.*; public class Yukicoder_22{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); int K = stdIn.nextInt(); String str = stdIn.next(); char par = str.charAt(K-1); if(par == (char)'('){ int count = 1; for(int i=K;i=0;i--){ if(str.charAt(i) == (char)'('){ count--; } else{ count++; } if(count == 0){ System.out.println(i+1); break; } } } } }