#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  int a[t];
  for (int i = 0; i < t; i++) {
    cin >> a[i];
  }
  int minim = a[0];
  int maxim = a[0];
  int count = 0;
  for (int i = 0; i < t; i++) {
    if (i == 0) {
      continue;
    }
    if (a[i] > maxim) {
      maxim = a[i];
      count++;
    } else if (a[i] < minim) {
      minim = a[i];
      count++;
    }
  }
  cout << count << "\n";
}
