#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long v[n];
  long long mx = 0, mn = 1000000007;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mx = max(mx, v[i]);
    mn = min(mn, v[i]);
  }
  sort(v, v + n);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] < mx && v[i] > mn) ans++;
  }
  cout << ans;
}
