#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, arr[100001];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int Min = 0, Max = 0;
  for (int i = 1; i < n; i++) {
    if (arr[i] > arr[0]) {
      Max = arr[i];
      break;
    }
  }
  for (int i = 1; i < n; i++) {
    if (arr[i] < arr[0]) {
      Min = arr[i];
      break;
    }
  }
  int count = 0;
  if (Max == 0) {
    Max = arr[0];
  } else
    count++;
  if (Min == 0) {
    Min = arr[0];
  } else
    count++;
  for (int i = 1; i < n; i++) {
    if (arr[i] > Max) {
      Max = arr[i];
      count++;
    }
    if (arr[i] < Min) {
      Min = arr[i];
      count++;
    }
  }
  cout << count;
  return 0;
}
