#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main(){
	int n;
	string s;
	cin >>n >> s;
	vector<int> w(n,0),b(n,0);
	rep(i,n-1){
		b[i+1]=b[i];
		if (s[i]=='#')
			b[i+1]++;
	}
	for (int i=n;i>=1;--i){
		w[i-1]=w[i];
		if (s[i]=='.')
			w[i-1]++;
	}
	int ans=10000000;
	rep(i,n){
		ans = min(ans,(b[i]+w[i]));
	}
	cout <<ans <<endl;
}