#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[1005], i, max1, min1, count = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  max1 = a[0];
  min1 = a[0];
  for (i = 1; i < n; i++) {
    if (a[i] > max1) {
      max1 = a[i];
      count++;
    }
    if (a[i] < min1) {
      min1 = a[i];
      count++;
    }
  }
  cout << count;
}
