#include <bits/stdc++.h>
using namespace std;
int minn, maxx;
int n, ans;
int main() {
  cin >> n;
  cin >> minn;
  maxx = minn;
  for (int i = 1; i < n; ++i) {
    int a;
    cin >> a;
    if (a > maxx) maxx = a, ans++;
    if (a < minn) minn = a, ans++;
  }
  cout << ans;
  return 0;
}
