Redundant Braces
You are given a mathematical formula consisting of '*', '-', '+', '/'. The formula also contains brackets '()'. These formulas are given as assignments to the students for evaluation but the Teacher has made a small mistake while preparing the assignment. He has added redundant braces.
If the formula is ((a+b))+c, you can see there is an extra bracket around a+b, which means this formula has 1 redundant bracket.
Your task is to find whether the given formula consists of a redundant bracket or not.
Redundant Braces You are given a mathematical formula consisting of '*', '-', '+', '/'. The formula also contains brackets '()'. These formulas are given as assignments to the students for evaluation but the Teacher has made a small mistake while preparing the assignment. He has added redundant braces. If the formula is ((a+b))+c, you can see there is an extra bracket around a+b, which means this formula has 1 redundant bracket. Your task is to find whether the given formula consists of a redundant bracket or not.
Example Input ((a+b)) Output 1