#include <bits/stdc++.h>
using namespace std;
bool isprime(long long int n) {
  if (n == 0 || n == 1)
    return false;
  else {
    for (long long int i = 2; i * i <= n; i++) {
      if (n % i == 0) {
        return false;
      }
    }
  }
  return true;
}
long long int nextprime(long long int n) {
  long long int x = -1;
  for (long long int i = n + 1;; i++) {
    if (isprime(i)) {
      x = i;
      break;
    }
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  long long int mi = arr[0], mx = arr[0], count = 0;
  for (long long int i = 1; i < n; i++) {
    if (arr[i] < mi) {
      mi = arr[i];
      count++;
    }
    if (arr[i] > mx) {
      mx = arr[i];
      count++;
    }
  }
  cout << count << endl;
}
