#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, amazing = 0, maxx, minn, k;
  cin >> n;
  cin >> k;
  maxx = k;
  minn = k;
  for (int i = 1; i < n; i++) {
    cin >> k;
    if (k > maxx) {
      maxx = k;
      amazing++;
    } else if (k < minn) {
      minn = k;
      amazing++;
    }
  }
  cout << amazing << endl;
  return 0;
}
