#include <bits/stdc++.h>
int main() {
  int n, a[100001], i, c = 0, mx = 0, mn = 1e9;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > mx) mx = a[i];
    if (a[i] < mn) mn = a[i];
  }
  for (i = 0; i < n; i++)
    if (a[i] == mx || a[i] == mn) c++;
  printf("%d\n", n - c);
  return 0;
}
