#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int ans = 0, maxm = arr[0], minm = arr[0];
  for (int i = 1; i < n; i++) {
    if (arr[i] > maxm) {
      maxm = arr[i];
      ans++;
    }
    if (arr[i] < minm) {
      minm = arr[i];
      ans++;
    }
  }
  cout << ans << endl;
}
