#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[1001], c, d, x = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    c = 0;
    d = 0;
    for (int j = (i - 1); j >= 1; j--) {
      if (a[i] < a[j])
        c++;
      else if (a[i] > a[j])
        d++;
    }
    if (c == (i - 1) || d == (i - 1)) x++;
  }
  x--;
  cout << x << endl;
  return 0;
}
