#include
using namespace std;
int main() {
int t;
cin>>t;
while(tβ)
{
int n,x=0;
cin>>n;
string s;
cin>>s;
int a=0,b=0,l = 2*n;
for(int i=0; i<l ; i++)
{
x++;
if(i%2 == 0)
{
if(s[i]==β1β)
a +=1;
}
else
{
if(s[i]==β1β)
b +=1;
}
if(x%2==0)
{
if(x==l && a == b)
{
cout<<l<<"\n";
break;
}
if(abs(a-b) > (l-x)/2)
{
cout<<x<<"\n";
break;
}
}
}
}
return 0;
}