#include<bits/stdc++.h>
using namespace std;
void solve()
{
int n; cin>>n;
string s;
cin>>s;
int cnt = 0;
bool a = 0, e=0,i=0,u=0,o =0;
for(int i=0;i<n;i++)
{
if(i==0)
{
if(s[i]=='a') a = 1;
if(s[i]=='e') e = 1;
if(s[i]=='i') i = 1;
if(s[i]=='o') o = 1;
if(s[i]=='u') u = 1;
continue;
}
if(s[i]!=s[i-1])
{
if(s[i]=='a')
{
if(a) cnt++;
}
if(s[i]=='e')
{
if(e) cnt++;
}if(s[i]=='i')
{
if(i) cnt++;
}if(s[i]=='o')
{
if(o) cnt++;
}if(s[i]=='u')
{
if(u) cnt++;
}
}
}
cout<<cnt<<endl;
}
int32_t main()
{
int t; cin>>t;
while(t--)
{
solve();
}
return 0;
}