#include using namespace std; typedef long long ll; typedef long double ld; #define rep(i,n) for (int i = 0; i < (n); ++i) templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b mem(200001,-1); int main(){ cin.tie(0); ios::sync_with_stdio(false); int n,k;cin >> n >> k; string s;cin >> s; k--; int cnt=0; if(s[k]=='('){ for(int i=k+1;i=0;i--){ if(s[i]=='('){ if(cnt==0){ cout << i+1 << endl; return 0; } cnt++; } else{ cnt--; } } } }