# -*- coding: utf-8 -*- def match(l, r): if l[1] == '(' and r[1] == ')': return True else: return False def reduce(hd, rest, goal): # print(str(hd) + ", " + str(rest)) if match(hd, rest[0]): if hd[0] == goal: print(rest[0][0]) if rest[0][0] == goal: print(hd[0]) return rest[1:] else: rest_ = reduce(rest[0], rest[1:], goal) return reduce(hd, rest_, goal) def solve(n, k, s): ls = [(i+1, c) for i, c in enumerate(s)] reduce(ls[0], ls[1:], k) n, k = input().split() s = input() solve(int(n), int(k), s)