#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 a1,…,ana_1,\ldots,a_n. A person is selected if there is at least one strictly weaker person and at least one strictly stronger person.

Let L=min⁡iaiL=\min_i a_i and R=max⁡iaiR=\max_i a_i. Count the elements satisfying L<ai<RL<a_i<R.

Input

  • Line 1: integer nn.
  • Line 2: nn strengths.

Output

Print the count.

Subtask

Subtask 1 (100 points): 1≤n≤1051\le n\le10^5; 0≤ai≤1090\le a_i\le10^9.

Example

Input

3
1 2 5

Output

1

Explanation

Only 22 lies strictly between 11 and 55.