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

int main() {
	int n,black= 0,sum,white=0,minv=200005;//blackは黒に、whiteは白にぬりかえるもの
	int j;
	cin >> n;
	string s;
	cin >> s;
	for (int i = 0; i < n; ++i) {
		if (s[i] == '.')++white;
	}
	for (int i = 0; i <= n; ++i) {
		if (i) {
			if (s[i-1] == '#') ++black;
			else --white;
		}
		sum = white + black;
		minv = min(sum, minv);
	}
	cout << minv << endl;
	return 0;
}