#include<iostream>
using namespace std;

int main() {
    int t, n;
    cin >> t;
    while (t--) {
        int answer = 0;
        cin >> n;
        char v[n];
        for (int i = 0; i < n; i++) {
            cin >> v[i];
        }
        for (int i = 0; i < n; i++) {
            if (v[i] == '.') {
                answer ++;
                i += 2;
            }
        }
        cout << answer << endl;
    }
    return 0;
}