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