#include using namespace std;int main(){int n,k,a=0;string s;cin>>n>>k>>s;k--;if(s[k]=='('){do{if(s[k]=='(')a++;else a--;k++;}while(a);k--;}else{do{if(s[k]=='(')a++;else a--;k--;}while(a);k++;}cout<