#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int d, count = 0;
  cin >> d;
  int m1 = d, m2 = d;
  count = 0;
  n--;
  while (n--) {
    cin >> d;
    if (m1 < d) {
      count++;
      m1 = d;
    }
    if (m2 > d) {
      count++;
      m2 = d;
    }
  }
  cout << count;
}
