#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, min, max, t = 0, n, a;
  cin >> n >> a;
  min = a, max = a;
  for (i = 1; i < n; i++) {
    cin >> a;
    if (a > max) {
      max = a;
      t++;
    }
    if (a < min) {
      min = a;
      t++;
    }
  }
  cout << t << endl;
  return 0;
}
