You have a string s of length n, consisting of characters "(" and ")". There are two types of query:
A subsequence of length |x| of string s=s1s2...s|s| (where |s| is the length of string s) is string x=sk1sk2...sk|x| (1≤k1<k2<...<k|x|≤|s|).
A correct bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters "1" and "+" between the characters of the string. For example, bracket sequences "()()", "(())" are correct (the resulting expressions "(1)+(1)", "((1+1)+1)"), and ")(" and "(" are not.
Input:
The first line contains two integers n and m — the length of the string s and the number of queries correspondingly. The next line contains a sequence of characters s1,s2,...,sn without any spaces. Each character is either a "(" or a ")". Each of the next m lines contains a number that denotes the type of the query followed by a pair of integers. The i−th line contains integers t,l,r — the description of the i−th query.
Output:
For each query of type 2 print the required answer on a new line.
Constraints:
2 8 8: This query is of type 2. There is no correct bracket subsequence in "(". Hence the answer is 0.
2 1 3: This query is also of type 2. The correct bracket subsequence in ")()" is "()". Hence the answer is 2.
1 7 8: This query is of type 1. Here we have to invert the parentheses having index between 7 and 8. Hence the new sequence is ")())(())(".
2 2 8: This query is of type 2. The maximum length of correct bracket subsequence in "())(())" is "()(())". Hence the answer is 6.