Checking if parentheses are balanced.