#include <bits/stdc++.h>
using namespace std;
int a, s, d[100002], f = 1000000000, g = 0, h, j, k, l, i, n, m;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> d[i];
    g = max(g, d[i]);
    f = min(f, d[i]);
  }
  for (i = 0; i < n; i++) {
    if (d[i] != f && d[i] != g) k++;
  }
  cout << k;
}
