#include<bits/stdc++.h>
#define  __  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

int main()
{
    __;

    int n,white=0,ans=0;

    string s;

	cin >> n >> s;

	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '.') white++;
	}

	 ans = white;

	for (int i = 0; i < s.size(); i++) {

		if (s[i] == '#') white++;

		else white--;

		if (ans > white) ans = white;
	}

	cout<<ans;

    return 0;
}
