Given a permutation of numbers from to . Find its number in the lexicographical order.
The first line contains the integer (1 \leq n \leq 12). The next line contains the permutation of numbers.
Print the number of the permutation in lexicographical order.
Example 1