#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[100000];
  int n;
  cin >> n;
  int mn, mx;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i == 0) {
      mn = arr[i];
      mx = arr[i];
    }
    if (arr[i] > mx)
      mx = arr[i];
    else if (arr[i] < mn)
      mn = arr[i];
  }
  int cnt{0};
  for (int i = 0; i < n; i++)
    if (arr[i] == mn || arr[i] == mx) cnt++;
  cout << n - cnt;
  return 0;
}
