#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,stone[200001],stones[200001],ans=0x7fffffff;
	char s[200001];
	scanf("%d%s",&n,s);
	for(int i=0;i<n;i++)stone[i]=s[i]=='#';
	for(int i=n;i>=0;i--)stones[i]=stones[i+1]+stone[i];
	for(int i=0;i<=n;i++)ans=min(ans,stones[0]-2*stones[i]+n-i);
	printf("%d\n",ans);
}