#CCBCHBAHAI0000011. I_love_%username% (I_love_%username%)

I_love_%username% (I_love_%username%)

I_love_%username%

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem

Given scores a1,…,ana_1,\ldots,a_n in chronological order. For i≥2i\ge2, performance ii is amazing if it is strictly greater than every previous score or strictly smaller than every previous score. The first performance is not counted. Count amazing performances.

Input

Line 1 contains nn. Line 2 contains a1,…,ana_1,\ldots,a_n.

Output

Print the required integer answer.

Subtasks

Subtask 1 (20 points): 1≤n≤201\le n\le 20; 0≤ai≤10000\le a_i\le 1000.

Subtask 2 (30 points): 1≤n≤2001\le n\le 200; 0≤ai≤50000\le a_i\le 5000.

Subtask 3 (50 points): 1≤n≤10001\le n\le 1000; 0≤ai≤100000\le a_i\le 10000.

Example

Input

5
100 50 200 150 200

Output

2

Explanation

The values follow directly from the definitions and illustrate the valid index range of the array scan.