#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, count = 0;
  cin >> n >> x;
  int mayor, menor;
  mayor = menor = x;
  for (int i = 1; i < n; i++) {
    cin >> x;
    if (x > mayor && x > menor || x < menor && x < menor) count++;
    if (x > mayor) mayor = x;
    if (x < menor) menor = x;
  }
  cout << count;
  return 0;
}
