#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  int Min, Max, ans = 0;
  cin >> n;
  int arr[n];
  cin >> arr[0];
  Max = Min = arr[0];
  for (i = 1; i < n; i += 1) {
    cin >> arr[i];
    if (arr[i] > Max) {
      Max = arr[i];
      ans += 1;
    }
    if (arr[i] < Min) {
      Min = arr[i];
      ans += 1;
    }
  }
  cout << ans;
  return 0;
}
