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

int main() {
	int n, tmp, min;
	string s;
	int count, ans;
	cin >> n >> s;
	tmp = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == '.') tmp++;
	}
	//シロの個数をtmpに数え上げた

	min = tmp; //今のところ最小は全部クロの場合＝白の個数が変える石の数

	for (int i = 0; i < n;i++) {
		if (s[i] == '.') tmp--; else tmp++;
		if (tmp < min) min = tmp;
	}
	cout << min << endl;
	cin >> n;
}