#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l = 0, j = 0, k = 0;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  j = arr[0];
  k = arr[0];
  for (int i = 0; i < n; i++) {
    if (arr[i] < j) {
      j = arr[i];
      l++;
    } else if (arr[i] > k) {
      k = arr[i];
      l++;
    }
  }
  cout << l;
  return 0;
}
