#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, max = -1, min = 10001, b = -2;
  cin >> n;
  vector<int> ar(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
    if (ar[i] > max) {
      max = ar[i];
      b++;
    }
    if (ar[i] < min) {
      min = ar[i];
      b++;
    }
  }
  cout << b;
  return 0;
}
