Increasing subsequence#5138

Increasing subsequence

1 segundo
128 megabytes
Difícil

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

Entrada

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.

Salida

Print the number of increasing subsequences in the given sequence.

Ejemplos

Ejemplo 1

Loading
Loading

Ejemplo 2

Loading
Loading