#CCBCHBAHAI0000020. Đếm số lần đổi dấu (Count Sign Changes)

Đếm số lần đổi dấu (Count Sign Changes)

Đếm số lần đổi dấu (Count Sign Changes)

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given an integer sequence a1,a2,…,ana_1,a_2,\ldots,a_n.

For each ii with 1≤i<n1\le i<n, the adjacent pair (ai,ai+1)(a_i,a_{i+1}) is a sign change exactly when one value is negative and the other is positive:

(ai<0<ai+1)  ∨  (ai+1<0<ai).(a_i<0<a_{i+1})\;\lor\;(a_{i+1}<0<a_i).

If ai=0a_i=0 or ai+1=0a_{i+1}=0, that pair is not counted as a sign change.

Count the indices ii satisfying the condition.

Input

The first line contains integer nn. The second line contains nn space-separated integers a1,a2,…,ana_1,a_2,\ldots,a_n.

Output

Print one integer: the number of sign changes between adjacent elements.

Subtasks

Subtask 1 (100 points): 1≤n≤2⋅1051\le n\le 2\cdot 10^5; ∣ai∣≤109|a_i|\le 10^9.

Example

Input

6
-3 2 0 -5 4 -1

Output

3

Explanation

The pairs (−3,2)(-3,2), (−5,4)(-5,4), and (4,−1)(4,-1) change sign. Pairs containing 00 are not counted.