You are editing a list of spreadsheet cells. Initially all cells are empty. You can perform two types of operations:
Given the final cell values that you would like to have in the spreadsheet, calculate the minimum number of editing operations required to obtain those values.
The first line of input contains a single integer $n$ ($1 \leq n \leq 800$), which is the number of cells you are editing. The cells are number from $1$ to $n$.
Each of the next $n$ lines contains a single integer between $0$ and $10^9$ inclusive. The integer on the $i^{\text{th}}$ line is $0$ if cell $i$ should be empty after all operations. Otherwise, it is a positive integer that is the final value of cell $i$.
Output a single integer, which the minimum number of editing operations required.