#include <bits/stdc++.h>
using namespace std;
int m;
bool best[1000], worst[1000];
int main() {
  int n, a[1000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i != 0)
      if (a[i] > a[0])
        for (int z = 0; z < i; z++) {
          if (a[z] < a[i])
            best[i] = true;
          else {
            best[i] = false;
            z = i;
          }
        }
      else if (a[i] < a[0])
        for (int z = 0; z < i; z++) {
          if (a[z] > a[i])
            worst[i] = true;
          else {
            worst[i] = false;
            z = i;
          }
        }
    if (best[i] || worst[i]) m++;
  }
  cout << m;
  return 0;
}
