#include<iostream>
#include<algorithm>
#include<vector>
#include<math.h>
#include<map>
#include<string>
using namespace std;

int main() {
	int N, C[200005];
	string S;
	cin >> N >> S;

	C[0] = 0;

	for (int i = 0; i < N; i++) {
		C[i + 1] = C[i];
		if (S.at(i) == '.') C[i + 1]++;
	}

	int ans = 2000000;
	for (int i = 0; i <= N; i++) {
		int cnt = i - C[i] + C[N] - C[i];
		ans = min(ans, cnt);
	}

	cout << ans << endl;
	return 0;
}
