Interval Addition

시간 제한4초메모리 제한2048 MB

문제

You are given an array $a$ of $n$ integers. You can perform operations on this array. In a single operation, you can add any real number $x$ to some consecutive interval of $a$.

Determine the minimum number of operations that have to be performed to make all elements of $a$ equal to $0$.

입력

The first line contains an integer $n$ ($1 \leq n \leq 23$).

The second line contains the array $a_1, a_2, \ldots, a_n$ ($0 \leq a_i \leq 10^9$).

출력

Print a line with a single integer: the minimum number of operations needed.