#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 123;
int n, a[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1, _b = n; i <= _b; ++i) cin >> a[i];
  int mn = a[1], mx = a[1];
  for (int i = 1, _b = n; i <= _b; ++i) mn = min(mn, a[i]);
  for (int i = 1, _b = n; i <= _b; ++i) mx = max(mx, a[i]);
  int res = 0;
  for (int i = 1, _b = n; i <= _b; ++i)
    if (a[i] > mn && a[i] < mx) ++res;
  cout << res << endl;
  return 0;
}
