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