#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;
	
	int wsum=0;
	REP(i,n){
		if(s[i]=='.') wsum++;
	}
	
	int bsum=0;
	int ans=wsum;//全部Bのとき.
	REP(i,n){//i番目はW.
		if(s[i]=='#'){
			bsum++;
			ans=min(ans,wsum+bsum);
		}else{
			wsum--;
			ans=min(ans,wsum+bsum);
		}
	}
	
	cout<<ans<<endl;
}//解説参考.