#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long temp, counts = 0;
  cin >> temp;
  long long maxi = temp, mini = temp;
  for (int i = 1; i < n; i++) {
    cin >> temp;
    if (temp > maxi) {
      maxi = temp;
      counts++;
    }
    if (temp < mini) {
      mini = temp;
      counts++;
    }
  }
  cout << counts;
  cout << "\n";
  return 0;
}
