#include <bits/stdc++.h>
int main() {
  int n;
  int MAX, MIN, x, ans = 0;
  scanf("%d", &n);
  scanf("%d", &x);
  MIN = MAX = x;
  for (int i = 1; i < n; i++) {
    scanf("%d", &x);
    if (x > MAX) {
      MAX = x;
      ans++;
    }
    if (x < MIN) {
      MIN = x;
      ans++;
    }
  }
  printf("%d\n", ans);
}
