#include <bits/stdc++.h>
using namespace std;
int coders, a[1002], ans;
bool ok, ok2, ok3, ok4;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> coders;
  for (int i = 0; i < coders; i++) cin >> a[i];
  for (int i = 1; i < coders; i++) {
    ok = false, ok2 = true;
    ok3 = false, ok4 = true;
    int z = i, cur = a[i];
    while (z--) {
      if (a[i] > a[z])
        ok = true;
      else
        ok2 = false;
      if (a[i] < a[z])
        ok3 = true;
      else
        ok4 = false;
    }
    if (ok && ok2 || ok3 && ok4) ans++;
  }
  cout << ans << endl;
  return 0;
}
