#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], i, c, min, max;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (a[0] > a[1])
    min = a[1], max = a[0];
  else if (a[0] < a[1])
    max = a[1], min = a[0];
  else if (a[0] == a[1])
    max = a[0], min = a[0];
  if (max == min)
    c = 0;
  else
    c = 1;
  for (i = 1; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      if (a[i + 1] < min) {
        min = a[i + 1];
        c++;
      }
    } else if (a[i] < a[i + 1]) {
      if (a[i + 1] > max) {
        max = a[i + 1];
        c++;
      }
    }
  }
  if (n == 1)
    cout << "0";
  else
    cout << c;
}
