stewards_count = int(input())
stewards = list(map(int, input().strip().split()))
supp = 0
minS = min(stewards)
maxS = max(stewards)
for i in stewards:
if minS < i < maxS:
supp += 1
print(supp)
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> vec;
for(int i=0; i<n; i++)
{
int x;
cin>>x;
vec.push_back(x);
}
sort(vec.begin(), vec.end());
int boro = vec[0];
int choto = vec[0];
int distinct = 1;
for(int i=0; i<n-1; i++)
{
if(vec[i] != vec[i+1])
distinct++;
if(boro < vec[i+1])
boro = vec[i+1];
if(choto > vec[i+1])
choto = vec[i+1];
}
//cout<<"distinct "<<distinct<<endl;
if(distinct <= 2)
cout<<0<<endl;
else
{
int cnt=1;
for(int i=0; i<n; i++)
{
if(vec[i] != vec[i+1]) break;
else cnt++;
}
cnt++;
for(int i=n-1; i>0; i--)
{
if(vec[i] != vec[i-1]) break;
else cnt++;
}
cout<<n-cnt<<endl;
}
return 0;
}
1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts | 501A - Contest |
160A- Twins | 752. Open the Lock |
1535A - Fair Playoff | 1538F - Interesting Function |
1920. Build Array from Permutation | 494. Target Sum |
797. All Paths From Source to Target | 1547B - Alphabetical Strings |
1550A - Find The Array | 118B - Present from Lena |
27A - Next Test | 785. Is Graph Bipartite |
90. Subsets II | 1560A - Dislike of Threes |
36. Valid Sudoku | 557. Reverse Words in a String III |
566. Reshape the Matrix | 167. Two Sum II - Input array is sorted |
387. First Unique Character in a String | 383. Ransom Note |
242. Valid Anagram | 141. Linked List Cycle |
21. Merge Two Sorted Lists | 203. Remove Linked List Elements |
733. Flood Fill | 206. Reverse Linked List |
83. Remove Duplicates from Sorted List | 116. Populating Next Right Pointers in Each Node |