A regular bracket sequence is a sequence of '' and '' characters defined as follows:
For a string that consists of only '' and '' characters, consider a sequence of operations that are of one of the following types:
Input format
Output format
For the query of the type , print the length of the longest regular bracket sequence starting at index .
Input Constraints
After every query: