package no022; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); String s = sc.next(); int nest = 0; while(true) { if (s.charAt(k-1) == '(') { nest++; }else{ nest--; } if (nest == 0) { break; } if (nest > 0) { k++; }else{ k--; } } System.out.println(k); } }