Almost Increasing Array#11521

Almost Increasing Array

3 seconds
512 megabytes
Hard

We call an array almost increasing if we can erase not more than one element from it so that the array becomes strictly increasing (that is, every element is strictly greater than every element before it).

Input

The first line contains one integer n~(2 \le n \le 2 \cdot 10^5) — the number of elements in .

The second line contains integers a_1, a_2, ..., a_n~(1 \le a_i \le 10^9) — the array .

Output

Print the minimum number of replacements you must perform so that is almost increasing.

You are given an array consisting of elements. You are allowed to replace any element with any integer number (and you may do so any number of times you need). What is the minimum number of replacements you must perform to make the array almost increasing?

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading