#include <bits/stdc++.h>
using namespace std;
int main() {
  int smallest, largest, n, count = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (i == 0) {
      smallest = a;
      largest = a;
    } else {
      if (a > largest) {
        count += 1;
        largest = a;
      } else if (a < smallest) {
        count += 1;
        smallest = a;
      }
    }
  }
  cout << count;
}
