eolymp
bolt
Try our new interface for solving problems
Problems

Remove the parentheses

Remove the parentheses

Time limit 1 second
Memory limit 128 MiB

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 data

One line consisting of no more than 10^5 parentheses.

Output data

Print the answer to the problem.

Examples

Input example #1
())(()
Output example #1
2
Input example #2
))(((
Output example #2
5
Input example #3
(()(()))
Output example #3
0