#include <bits/stdc++.h>
using namespace std;
int n;
int solution() { return 0; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  int ans = 0;
  int num;
  cin >> num;
  int maxn = num;
  int minn = num;
  for (int i = 1; i < n; i++) {
    cin >> num;
    if (num > maxn) {
      ans++;
      maxn = num;
    } else if (num < minn) {
      ans++;
      minn = num;
    }
  }
  cout << ans;
  return 0;
}
