Consider bracket sequences with one type of parenthesis. For the given bracket sequence, find the number of its subsequences that are valid bracket sequences.
For example, for the sequence ((())())(, there are eight such subsequences: ((())()), (())(), ((())), (()()), (()), ()(), (), and the empty sequence.
The input contains a sequence of no more than round brackets.
Print the number of different correct bracket subsequences for the given bracket sequence.
Example 1