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