#include <bits/stdc++.h>
using namespace std;
int arr[100000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int count = 0;
  int max = *max_element(arr, arr + n);
  int min = *min_element(arr, arr + n);
  for (int i = 0; i < n; i++) {
    if (min < arr[i] && arr[i] < max) {
      count++;
    }
  }
  cout << count;
  return 0;
}
