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