#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, max, min, i, x, am = 0;
  cin >> n >> max;
  min = max;
  if (n == 1)
    cout << 0;
  else {
    for (i = 1; i <= n; i++) {
      cin >> x;
      if (x > max) {
        max = x;
        am++;
      }
      if (x < min) {
        min = x;
        am++;
      }
    }
    cout << am;
  }
}
