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 striclty greater than every element before it).

You are given an array *a* consisting of *n* 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 have to perform in order to make the array almost increasing?
The first line contains one integer *n* (2 ≤ *n* ≤ 200000) — the number of elements in *a*.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the array *a*.
none
5
5 4 3 2 1
3
5
1 2 8 9 5
0
15
1013 8003 4947 359 17360 21594 25180 25764 22357 22357 16649 12544 23382 10579 25937
7
8
1 1 1 1 1 1 1 1
6
7
100 105 108 108 107 108 109
1
7
1 5 6 2 3 4 5
2
5
3 4 1 2 5
1
8
53 8 4 6 4 3 8 5
4
6
13 7 4 3 1 4
3
6
6 1 6 2 1 5
2
4
1 2 1 2
1
8
1 5 2 3 4 7 5 6
2
4
2 1 2 21
0
4
1 2 3 4
0
5
1 2 3 2 1
1
14
6 7 8 9 10 11 12 13 14 15 16 17 18 19
0
2
1 2
0
n = int(input())
arr = list(map(int, input().split()))

moves = 0

for i in range(1, n):
    if arr[i] < arr[i - 1]:
        moves += arr[i - 1] - arr[i]
        arr[i] = arr[i - 1]

print(moves)
