#CCBCHBA0000019. Đếm số ngoài đoạn (Count Values Outside Interval)

Đếm số ngoài đoạn (Count Values Outside Interval)

Count Values Outside Interval

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Count input values strictly outside the closed interval [L,R], i.e. xR. Values exactly equal to endpoints are inside.

Input

n in [0,100000]; integers L<R in [-1000000,1000000]; then n values in the same range.

Output

The count of values outside [L,R].

Subtasks

  • Subtask 1 (20%): n≤5n\le5, ∣L∣,∣R∣,∣ai∣≤10|L|,|R|,|a_i|\le10.
  • Subtask 2 (30%): n≤100n\le100, các trị tuyệt đối ≤1000\le1000.
  • Subtask 3 (50%): n≤100000n\le100000, các trị tuyệt đối ≤106\le10^6.

Examples

Example 1

Input

4 2 5
1 2 5 6

Output

2

Explanation

Only 1 and 6 lie outside the interval; both endpoints are included.

Example 2

Input

0 -2 2

Output

0

Explanation

There are no values to examine.