LearnPy Hub
← Arena
IntermediateRating 1200

Fix the Brackets

Given a string of ( and ), print the minimum number of brackets to insert to make it balanced.

Input

One line.

Output

A number.

Sample 1

Input
())
Output
1

Sample 2

Input
(((
Output
3
solution.py
Output appears here
Fix the Brackets · Python Arena problem · LearnPy Hub