#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int idk;
  cin >> idk;
  int mi = idk, ma = idk, ans = 0;
  for (long long i = 1; i < n; i++) {
    cin >> idk;
    if (idk < mi) {
      ans++;
      mi = idk;
    } else if (idk > ma) {
      ans++;
      ma = idk;
    }
  }
  cout << ans << endl;
}
