#include <bits/stdc++.h>
int main(void) {
  long long n, t, i, min, max, co = 0, c = 0;
  scanf("%lld", &n);
  long long a[n];
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  max = a[1];
  min = a[1];
  for (i = 2; i <= n; i++) {
    if (a[i] > max) {
      max = a[i];
      c++;
    } else if (a[i] < min) {
      min = a[i];
      co++;
    }
  }
  printf("%lld\n", co + c);
}
