#include <bits/stdc++.h>
using namespace std;
int n, m;
bool debug = false;
int k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int main() {
  int l, r, ans = 0;
  scanf("%d", &n);
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    scanf("%d", &m);
    if (!i) {
      l = r = m;
    } else {
      if (m > r) {
        ans++;
        r = m;
      } else if (m < l) {
        ans++;
        l = m;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
