Given a string of ( and ), find the length of the longest valid (well-formed) parentheses substring.
(
)
Input: one string of parentheses. Output: the length.
Your program reads from stdin and prints to stdout.
Example 1
Input: (()
Output: 2
Hints