#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N;
	string S;
	cin >> N >> S;
	vector<int> B(N+1, 0);
	vector<int> W(N+1, 0);

	int black = 0, white = 0;
	for (int i = 0; i < N; i++) {
        if (S[i] == '#') {
			black++;
		}
		B[i + 1] = black;
		if (S[N - i - 1] == '.') {
			white++;
		}
		W[N - i - 1] = white;
	}

	int ans = 10e8;
	for (int i = 0; i <= N; i++) {
		ans = min(ans, B[i] + W[i]);
	}
	cout << ans << endl;	
}