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

int main() {
	// your code goes here
	int n, cnt=0,key=1;
	string str;
	
	cin >> n;
	cin >> str;
	
	char log[n] = {};
	
	if(str[0] == '#' && str[1] == '.'){
		str[0] = '.';
		cnt++;
	}
	while(1) {
		key = str.find(".#.");
		if(key== string::npos) {
			//break;
		} else {
			str[key+1] = '.';
			//log[key] = '1';
			cnt++;
			//cout << str<< endl;
		}
		
		key = str.find("##.");
		if(key== string::npos) {
			break;
		} else {
			str[key+2] = '#';
			//log[key] = '1';
			cnt++;
			//cout << str<< endl;
		}
	}
	
	/*
	for(int i=0 ; i<n ; i++) {
		if(log[n] == '1') cnt++;
	}
	*/
	cout << cnt << endl;
	return 0;
}