#include <bits/stdc++.h>
using namespace std;
const int INF = 2 << 20;
const double EPS = 1E-8;
const int MAX_N = 100100;
int main() {
  int A[MAX_N];
  int n;
  scanf("%d", &n);
  ;
  int mi = 1000000000, ma = 0;
  for (__typeof(n) i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    ;
    A[i] = a;
    mi = min(a, mi);
    ma = max(a, ma);
  }
  int count = 0;
  for (__typeof(n) i = 0; i < n; i++) {
    if (mi < A[i] && A[i] < ma) {
      count++;
    }
  }
  printf("%d", count);
}
