Sereja has a bracket sequence s1,s2,...,sn, or, in other words, a string s of length n, consisting of characters "(" and ")".
Sereja needs to answer m queries, each of them is described by two integers li,ri (1≤li≤ri≤n). The answer to the i-th query is the length of the maximum correct bracket subsequence of sequence sli,sli+1,...,sri. Help Sereja answer all queries.
You can find the definitions for a subsequence and a correct bracket sequence in the notes.
Output
Print the answer to each question on a single line. Print the answers in the order they go in the input.
Note
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 aryphmetic ex
pression 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.
For the third query required sequence will be «()».
For the fourth query required sequence will be «()(())(())».