Problems
Increasing subsequence
Increasing subsequence
A sequence of integers is given. Find the number of its increasing subsequences.
Input
First line contains the length of a sequence n (1 ≤ n ≤ 500). Second line contains all its elements (positive integers, less than 5000).
Output
Print the number of its increasing subsequences.
Input example #1
3 1 2 3
Output example #1
7
Input example #2
3 3 1 2
Output example #2
4