#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  if (N > 1000) {
    cout << "Number of contest cannot exceed 1000!";
    exit;
  }
  int arr[N];
  for (int i = 0; i < N; i++) {
    cin >> arr[i];
    if (arr[i] > 10000) {
      cout << "Point cannot exceed 10000!";
      exit;
    }
  }
  int min, max, ans;
  min = arr[0];
  max = arr[0];
  for (int i = 1; i < N; i++) {
    if (arr[i] < min) {
      min = arr[i];
      ans++;
    } else if (arr[i] > max) {
      max = arr[i];
      ans++;
    }
  }
  ans = ans - 2;
  cout << ans << endl;
}
