Given integers and , your task is to determine the total number of non-monotonic sequences of length , where each element is a non-negative integer not greater than .
A sequence is considered monotonic if its elements either do not decrease or do not increase as the index progresses.
The first line contains the integer , and the second line contains the integer (1 \leq n \leq 10, 0 \leq m \leq 30).
Output a single line containing the answer to the problem.
Example 1