import java.util.Scanner; public class no22{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int k = scan.nextInt(); String s = scan.next(); int count = 0; int i; if(s.charAt(k-1) == '('){ for(i=k-1;i=0;i--){ if(s.charAt(i) == ')') count++; else count--; if(count == 0){ System.out.println(i+1); break; } } } } }