#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
int a,b=0,c;
string s;
signed main()
{
	cin>>a>>s;
	rep(i,a){
		if(s[i]=='.'){
			b++;
		}
	}
	c=b;
	rep(i,a){
		if(s[i]=='#'){
			b++;
		}else{
			b--;
		}
		if(c>b){
			c=b;
		}
	}
	cout<<c;
}