Problems
Remove the parentheses
Remove the parentheses
Given a string consisting of parentheses.
Determine the minimum number of characters to be removed from this string, so that the remaining characters will form the correct bracket sequence.
Input
One line consisting of no more than 105
parentheses.
Output
Print the answer to the problem.
Input example #1
())(()
Output example #1
2
Input example #2
))(((
Output example #2
5
Input example #3
(()(()))
Output example #3
0