#include<stdio.h>
#include<string.h>
int main()
{
long long int t;
char s[500001];
long long int i=0,length=0,jump=0,day=0;
scanf("%Ld",&t);
while(t--)
{
scanf("%s",&s);
while(s[i]!='\0')
{
if(s[i]=='.')
length++;
else
{
if(jump>=length)
length=0;
else
{
day++;
jump=length;
length=0;
}
}
i++;
}
printf("%lld",day);
printf("\n");
memset(s,0,sizeof(s)*sizeof(char));
i=0;length=0;jump=0;day=0;
}
return 0;
}