count the number of ways of parenthesizing the expression