#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar[n];
  int cnt = 0;
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int i = 1; i < n; i++) {
    bool mn = 1, mx = 1;
    for (int j = i - 1; j >= 0; j--) {
      if (ar[i] <= ar[j]) mx = 0;
      if (ar[i] >= ar[j]) mn = 0;
    }
    if (mn == 1 || mx == 1) cnt++;
  }
  cout << cnt << endl;
}
