Increasing subsequence#5138

Increasing subsequence

1 second
128 megabytes
Hard

Given a sequence of integers. Find the number of its increasing subsequences.

Input

The first line contains an integer n~(1 \le n \le 500), representing the length of the sequence. The second line contains positive integers, each less than , which are the elements of the sequence.

Output

Print the number of increasing subsequences in the given sequence.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading