#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, K; cin >> N >> K; string S; cin >> S; vector pos(N, 0); stack st; for (int i = 0; i < N; i++) { if (S[i] == '(') st.push(i); if (S[i] == ')') { pos[i] = st.top(); pos[st.top()] = i; st.pop(); } } cout << pos[K - 1] + 1 << '\n'; return 0; }