#CCBCHBAHAI0000168. Lời thề của Đội Tuần Đêm (Oath of the Night's Watch)
Lời thề của Đội Tuần Đêm (Oath of the Night's Watch)
Oath of the Night's Watch
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem
Given strengths . A person is selected if there is at least one strictly weaker person and at least one strictly stronger person.
Let and . Count the elements satisfying .
Input
- Line 1: integer .
- Line 2: strengths.
Output
Print the count.
Subtask
Subtask 1 (100 points): ; .
Example
Input
3
1 2 5
Output
1
Explanation
Only lies strictly between and .