#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 in chronological order. For , performance 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 . Line 2 contains .
Output
Print the required integer answer.
Subtasks
Subtask 1 (20 points): ; .
Subtask 2 (30 points): ; .
Subtask 3 (50 points): ; .
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.