#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;

int main() {
	long lopng int N,cnt = 0;
	char shape = '#',dot = '.';
	string S;
	cin >> N >> S;

	for (int i = 0; i < N; i++)
	{
		if( i > 0 ){
		if ( S[i-1] == shape && S[i] == dot ) cnt++;
	}
	}
		cout << cnt << endl;
		return 0;
	}
