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

int main() {

	int n, tmp=0, min, cnt,ans;
	string s;

	cin >> n >> s;

	for (int i = 0; i < n; i++) {
		if (s[i] == '.')
			tmp++;
	}	//白の個数を計算

	min = tmp;

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

	cout << min ;


	return 0;
}