#include
#include<bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin>>t;
while(t--){long int cn;
cin>>cn;
short int s[cn];
long int temp=cn;
long int temp2=cn;
int x=0;
// for(int j=1;j<=cn;j++){
// cin>>s[j];
// }
while(cn--){
cin>>s[temp-cn];
}
// for(int i=2;i<=temp;i++){
// if(s[i]<=s[i-1]){
// x++;
// }
// }
while(temp--){if(temp==temp2-1){
continue;
}
if(s[temp2-temp]<=s[temp2-temp-1]){
x++;
}
}
cout<<x+1<<endl;
}
return 0;
}