#include <bits/stdc++.h>
using namespace std;
int main() {
  int b, i, c, a1, j, b1, c1, n, m, a[1001];
  string s, s1;
  cin >> n;
  cin >> a[1];
  for (i = 2; i <= n; i++) {
    cin >> a[i];
    b = a[i];
    sort(a + 1, a + i + 1);
    if (a[1] == b && a[1] != a[2]) m++;
    if (a[i] == b && a[i] != a[i - 1]) m++;
  }
  cout << m << endl;
}
