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