#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  int inp;
  int ac = 0;
  int more = 0;
  int less = 0;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; ++i) {
    cin >> inp;
    arr[i] = inp;
  }
  for (int j = 1; j < n; ++j) {
    for (int k = 0; k < j; ++k) {
      if (arr[k] > arr[j]) {
        more++;
      } else if (arr[k] < arr[j]) {
        less++;
      } else if (arr[k] == arr[j]) {
        more++;
        less++;
      }
    }
    if (!(more != 0 && less != 0)) {
      ac++;
    }
    more = 0;
    less = 0;
  }
  cout << ac;
  return 0;
}
