#CCBCHBAHAI0000019. Đếm lần tăng/giảm giữa hai phần tử kề (Count Adjacent Increases and Decreases)

Đếm lần tăng/giảm giữa hai phần tử kề (Count Adjacent Increases and Decreases)

Count Adjacent Increases and Decreases

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given a1,…,ana_1,\ldots,a_n, let UU count adjacent strict increases and DD count adjacent strict decreases. Equal adjacent values count toward neither. Print UU and DD.

Input

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

Output

Print UU and DD.

Subtasks

Subtask 1 (20 points): 1≤n≤501\le n\le 50; ∣ai∣≤100|a_i|\le 100.

Subtask 2 (30 points): 1≤n≤50001\le n\le 5000; ∣ai∣≤1000000|a_i|\le 1000000.

Subtask 3 (50 points): 1≤n≤1000001\le n\le 100000; ∣ai∣≤1000000000|a_i|\le 1000000000.

Example

Input

6
3 5 5 2 7 1

Output

2 2

Explanation

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