#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, b = -1, w = 1e9, c = 0, d = 0, j;
  cin >> n;
  vector<int> v;
  int p[n];
  for (i = 0; i < n; i++) {
    cin >> p[i];
    for (j = 0; j < i; j++) {
      if (p[j] == p[i]) {
        d++;
      }
    }
    if (d == 0) {
      v.push_back(p[i]);
    }
    d = 0;
  }
  for (i = 0; i < v.size(); i++) {
    b = max(b, v[i]);
    w = min(w, v[i]);
    if (b == v[i] && w == v[i]) {
    } else if (b == v[i]) {
      c++;
    } else if (w == v[i]) {
      c++;
    }
  }
  cout << c;
  return 0;
}
