#include "bits/stdc++.h"
using namespace std;

int main()
{
  int n,ans,mn;
  ans=1;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++)
  {
    cin>>a.at(i);
  }
  mn=a.at(0);
  for(int i=1;i<n;i++)
  {
    if(mn>a.at(i))
      ans++;
    mn=min(mn,a.at(i));
  }
  cout<<ans<<endl;
}
#include <iostream>
#include <string>

using namespace std;

int main(void){
  string str;
  int n;
  int i=0;
  int ocnt=0, bcnt=0;
  int score=0;
  cin >> n;
  while(i < n){
	cin >> str;
	if(str == "OUT"){
	  ocnt++;
	}else if(str == "HIT"){
	  if(bcnt < 3){
		bcnt++;
	  }else{
		score++;
	  }
	}else if(str == "HOMERUN"){
	  score += bcnt+1;
	  bcnt = 0;
	}
	if(ocnt == 3){
	  cout << score << endl;
	  ocnt = 0;
	  bcnt = 0;
	  score = 0;
	  i++;
	}
  }
}