#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100005], n, cnt = 0, flag = 0, glaf = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    flag = 0;
    glaf = 0;
    for (int j = 0; j <= i - 1; j++) {
      if (a[i] > a[j]) {
        flag = 1;
      } else if (a[i] < a[j]) {
        glaf = 1;
      } else
        goto w;
      if (flag == 1 && glaf == 1) {
        flag = 0;
        glaf = 0;
        break;
      }
    }
    if ((flag == 1 && glaf != 1) || (glaf == 1 && flag != 1)) cnt++;
  w:;
  }
  cout << cnt;
  return 0;
}
