#include <bits/stdc++.h>
using namespace std;
long long n, ans;
vector<long long> a;
int main() {
  cin >> n;
  a.resize(n);
  long long min_A = 1 << 31 - 1;
  long long max_A = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > max_A) {
      max_A = a[i];
    }
    if (a[i] < min_A) {
      min_A = a[i];
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] < max_A && a[i] > min_A) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
