You are given a string of only the characters ( and ). A substring is well-formed if every opening bracket has a matching closing bracket and pairs are properly nested. Find the length of the longest contiguous well-formed substring.
Input format
A single line: a string of ( and ) characters (possibly empty).
Output format
A single integer: the length of the longest well-formed contiguous substring (0 if none).
Constraints
- 0 <= length of the string <= 100000