#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const int N=2e5+5;
int ans=1e9,n,dpa[N],dpb[N];
string s;
int main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	cin>>s;
	for(int i=0;i<n;i++)
	{
		dpa[i+1]=dpa[i]+(s[i]=='.');
		dpb[i+1]=dpb[i]+(s[i]=='#');
	}
	for(int i=0;i<=n;i++)
	{
		int pnt=dpb[i]+dpa[n]-dpa[i];
		ans=min(ans,pnt);
	}
	cout<<ans<<endl;
	return 0;
}