import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Deque; import java.util.ArrayDeque; import java.util.Collections; public class Main { public static void main(String[] args) { FS reader = new FS(); // write reader int N = reader.nextInt(); int K = reader.nextInt()-1; String S = reader.next(); if (S.charAt(K) == '(') { int cnt = 1; for (int i=K+1; i=0; i--) { if (S.charAt(i) == ')') cnt++; else { cnt--; if (cnt == 0) { System.out.println(i+1); break; } } } } } public static void output2DArray(boolean[][] a, int r) { for (int x=0; x