#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, c = 0;
  cin >> n >> x;
  int mx = x, mn = x;
  for (int i = 1; i < n; i++) {
    cin >> x;
    if (x > mx) {
      mx = x;
      c++;
    } else if (x < mn) {
      mn = x;
      c++;
    }
  }
  cout << c;
  return 0;
}
