#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int max, min, tmp, cnt = 0;
    scanf("%d", &tmp);
    max = min = tmp;
    n--;
    while (n--) {
      scanf("%d", &tmp);
      if (tmp > max) {
        cnt++;
        max = tmp;
      }
      if (tmp < min) {
        cnt++;
        min = tmp;
      }
    }
    printf("%d\n", cnt);
  }
  return 0;
}
