#include<cstdio>
#include<algorithm>
using namespace std;

#define ran 202202

int n;
char s[ran];
int sum[ran];

int main() {
	scanf("%d%s", &n, s);
	
	sum[0] = 0;
	for(int i=0;i<n;i++)
		sum[i+1] = sum[i] + (s[i]=='#');
	
	int ans = n;
	for(int i=0;i<=n;i++)
		ans = min(ans, sum[i] + (n-i)-(sum[n]-sum[i]));
	printf("%d\n", ans);
	
	return 0;
}