"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am the watcher on the walls. I am the shield that guards the realms of men. I pledge my life and honor to the Night's Watch, for this night and all the nights to come." — The Night's Watch oath.

With that begins the watch of Jon Snow. He is assigned the task to support the stewards.

This time he has n stewards with him whom he has to provide support. Each steward has his own strength. Jon Snow likes to support a steward only if there exists at least one steward who has strength strictly less than him and at least one steward who has strength strictly greater than him.

Can you find how many stewards will Jon support?


-----Input-----

First line consists of a single integer n (1 ≤ n ≤ 10^5) — the number of stewards with Jon Snow.

Second line consists of n space separated integers a_1, a_2, ..., a_{n} (0 ≤ a_{i} ≤ 10^9) representing the values assigned to the stewards.


-----Output-----

Output a single integer representing the number of stewards which Jon will feed.


-----Examples-----
Input
2
1 5

Output
0
Input
3
1 2 5

Output
1


-----Note-----

In the first sample, Jon Snow cannot support steward with strength 1 because there is no steward with strength less than 1 and he cannot support steward with strength 5 because there is no steward with strength greater than 5.

In the second sample, Jon Snow can support steward with strength 2 because there are stewards with strength less than 2 and greater than 2.

Difficulty: competition

Starter code:

Solutions:
x = int(input())
l = list(map(int, input().split(' ')))
if min(l) == max(l):
    print(0)
else:
    print(x-l.count(min(l))-l.count(max(l)))

def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    worst = a[0]
    best = a[-1]
    ans = 0
    for x in a:
        if worst < x and x < best:
            ans += 1

    print(ans)

main()


n = int(input())
line = list(map(int, input().split()))
m1 = min(line)
m2 = max(line)
ans = 0
for i in range(len(line)):
    if line[i] < m2 and line[i] > m1:
        ans += 1
print(ans)


n = int(input())
a = [int(x) for x in input().split()]

mn, mx = min(a), max(a)
cnt = 0
for a_i in a:
    if a_i != mn and a_i != mx:
        cnt += 1

print(cnt)


3

n = int(input())
A = list(map(int, input().split()))

mn = min(A)
mx = max(A)
ans = 0
for x in A:
    if mn < x < mx:
        ans += 1

print(ans)


n = int(input())
s = [int(i) for i in input().split()]
a = max(s)
b = min(s)
ans = 0
for i in s:
    if i!= a and i!=b:
        ans+=1
print(ans)

n = int(input())
a = list(map(int, input().split()))
mn = min(a)
mx = max(a)
ans = 0
for x in a:
    if x > mn and x < mx:
        ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))

r = 0

min_a = min(a)
max_a = max(a)

for i in a:
    if i > min_a and i < max_a:
        r +=1
print(r)


n = int(input())
l = list(map(int, input().split()))
l.sort()
# if len(set(l)) == 0:
# 	print(0)
# 	return
cnt = 0
for i in range(len(l)):
	if l[0] < l[i] < l[-1]:
		cnt += 1
print(cnt)


input()
a=list(map(int, input().split()))
mi=min(a)
ma=max(a)
ch=0
for i in range(len(a)):
    if a[i]!=mi and a[i]!=ma: ch+=1
print(ch)

n = int(input())
a = list(map(int, input().split()))
mx = max(a)
mn = min(a)
ans = n
for i in range(n):
    if a[i] == mx or a[i] == mn:
        ans -= 1
print(ans)

n = int(input())
l = sorted(list(map(int, input().split())))
ans = 0
for i in range(len(l)):
    if l[0] < l[i] and l[-1] > l[i]:
        ans += 1
print(ans)

import sys
n = int(input())
a = list(map(int, input().split()))
mn = min(a)
mx = max(a)
ans = 0
for i in range(n):
    if a[i] > mn and a[i] < mx:
        ans += 1
print(ans)

n = int(input().strip())
data = [int(x) for x in input().strip().split(' ')]

t = 0
mn,mx = data[0], data[0]
for x in data:
    mn = min(x,mn)
    mx = max(x,mx)

for x in data:
    if x > mn and x < mx:
        t += 1
print(t)


n=int(input())
l=list(map(int,input().split()))
mi=min(l)
ma=max(l)
count=0
for i in l:
	if(i!=mi and i!=ma):
		count+=1
print(count)

n = int(input())
a = list(map(int, input().split()))
minim = min(a)
maxim = max(a)
ans = 0
for i in a:
    if (minim < i < maxim):
        ans += 1
print(ans)

n = int(input())
mx_i = 0
mx_cnt = 0
mn_i = 0
mn_cnt = 0
arr = list(map(int, input().split()))
for i in range(n):
    if arr[i] > arr[mx_i]:
        mx_i = i
        mx_cnt = 1
    elif arr[i] == arr[mx_i]:
        mx_cnt += 1
    if arr[i] < arr[mn_i]:
        mn_i = i
        mn_cnt = 1
    elif arr[i] == arr[mn_i]:
        mn_cnt += 1
print(max(0, n - mx_cnt - mn_cnt)) 

n = int(input())
a = list(map(int, input().split()))
m = min(a)
M = max(a)
count = 0
for el in a:
    if el != m and el != M:
        count += 1
print(count)


n = int(input())

a = [int(x) for x in input().split(' ')]

m = min(a)
M = max(a)

res = n
res -= len([x for x in a if x == m or x == M])
    
print(res)


n = int(input())
a = list(map(int, input().split()))
a.sort()
r = 0
for i in a:
	if a[0] < i < a[-1]:
		r += 1
print(r)

n = int(input())
k = list(map(int, input().split()))
mn = min(k)
mx = max(k)
ans = 0
for i in k:
    if (mn != i != mx):
        ans += 1
print(ans)


import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

n=int(input())

stuff=list(map(int,input().split()))

a=min(stuff)
b=max(stuff)

ans=0

for i in stuff:
    if a<i<b:ans+=1
print(ans)


i = int(input())
A = list(map(int, input().split()))

A = sorted(A)
a_min = A[0]
a_max = A[len(A)-1]
B=[]

for i in range(1, len(A)-1):
    if A[i] != a_min and A[i] != a_max:
        B.append(A[i])

print(len(B))

n = int(input())
arr = [int(x) for x in input().split()]

M = max(arr)
m = min(arr)

cnt = 0

for i in arr:
    if i>m and i<M:
        cnt += 1

print(cnt)


n = int(input())
data = {
    
}
l = list(map(int,input().split()))
for x in l:
    if x not in data:
        data[x]=0
    data[x]= data[x] + 1
keys = list(data.keys())
keys.sort()
ans = 0
for i in range(1,len(keys)-1):
    ans = ans + data[keys[i]]
    
print(ans)