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

int main() {

	int N;
	string S; // .->白 #->黒

	cin >> N;
	cin >> S;

	int w = 0, b = 0, ans = 0;
	for (char c : S) {
		if (c == '.') {
			w++;
		}
	}
	ans = w;
	for (char c : S) {
		if (c == '#') {
			b++;
		}
		else {
			w--;
		}
		if (b + w < ans) {
			ans = b + w;
		}
	}
	cout << ans << endl;
}