#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, max, min;
  cin >> n;
  int arr1[n], arr2[n];
  for (int i = 0; i < n; i++) {
    arr2[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> arr1[i];
  }
  max = arr1[0];
  for (int i = 1; i < n; i++) {
    if (arr1[i] > max) {
      max = arr1[i];
      arr2[i] = 1;
    }
  }
  min = arr1[0];
  for (int i = 1; i < n; i++) {
    if (arr1[i] < min) {
      min = arr1[i];
      arr2[i] = 1;
    }
  }
  int tot = 0;
  for (int i = 0; i < n; i++) {
    if (arr2[i] == 1) {
      tot += 1;
    }
  }
  cout << tot;
}
