#include <bits/stdc++.h>
using namespace std;
int main() {
  bool flag = true;
  int n, min(10001), max(-1), counter(0), arr[1000];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    if (arr[i] > max) {
      max = arr[i];
      ++counter;
    }
    if (arr[i] < min) {
      min = arr[i];
      ++counter;
    }
  }
  cout << counter - 2 << endl;
  return 0;
}
