#include <bits/stdc++.h>
using namespace std;
int n, i, mn, mx, t;
int main() {
  cin >> n;
  mn = INT_MAX;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    mn = min(a[i], mn);
    mx = max(a[i], mx);
  }
  for (i = 0; i < n; i++) {
    if (mn < a[i] && mx > a[i]) t++;
  }
  cout << t;
}
