#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, arr[1001], ans = 0, x = 0, y = 0;
  cin >> t >> arr[0];
  for (int i = 1; i < t; i++) {
    cin >> arr[i];
    for (int j = 0; j < i; j++) {
      if (arr[j] < arr[i])
        x = 1;
      else if (arr[j] > arr[i])
        y = 1;
      else if (arr[j] == arr[i]) {
        y = 0;
        x = 0;
        j = i;
      }
    }
    if ((x == 1 && y == 0) || (x == 0 && y == 1)) ans++;
    x = 0;
    y = 0;
  }
  cout << ans << endl;
  return 0;
}
