using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { var va = Console.ReadLine().Split().Select(int.Parse).ToArray(); var sa = Console.ReadLine(); var sk = new Stack(); var pa = new int[va[0]]; for (int i = 0; i < va[0]; i++) { if (sa[i] == '(') sk.Push(i); else { int j = sk.Pop(); pa[i] = j; pa[j] = i; } } Console.WriteLine(pa[va[1] - 1] + 1); Console.ReadLine(); } } }