#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, Count = 0;
  cin >> n;
  int ar[n];
  for (i = 0; i < n; i++) {
    cin >> ar[i];
  }
  int Max = ar[0];
  int Min = ar[0];
  for (i = 1; i < n; i++) {
    if (ar[i] < Min) {
      Min = ar[i];
      Count++;
    }
    if (ar[i] > Max) {
      Max = ar[i];
      Count++;
    }
  }
  cout << Count << endl;
  return 0;
}
