#include<bits/stdc++.h>

using namespace std;

int sum[200005];
char s[200005];

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