Given a balanced parenthesis string s count the score obtained based on the following rules:
Example:
s is ()(())
Let us first calculate the score for (()). Here the innermost balanced parenthesis string has score of 1 (based on rule 1 above). Thus the whole string has the score 2 * 1 = 2 (based on rule 2)
Now the outer () has a score of 1. Therefore, final score = 1 + 2 = 3 (based on rule 3).