#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  std::vector<int> v;
  int temp;
  for (int i = 0; i < t; ++i) {
    scanf("%d", &temp);
    v.push_back(temp);
  }
  int x = INT_MAX, y = INT_MIN;
  for (int i = 0; i < v.size(); ++i) {
    x = min(x, v[i]);
    y = max(y, v[i]);
  }
  int ans = 0;
  for (int i = 0; i < v.size(); ++i) {
    if (v[i] > x && v[i] < y) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
