#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
const int INF = 0x3f3f3f3f;
int n;
int a[MAXN];
int mn = INF, mx;
int ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  for (int i = 1; i <= n; i++)
    if (a[i] > mn && a[i] < mx) ans++;
  cout << ans << endl;
  return 0;
}
