#include<bits/stdc++.h>
using namespace std;
int i,i0,n,m,k,pre[200005];
char s[200005];
int main()
{
    scanf("%d %s",&n,s);
    for(i=0;i<n;i++)pre[i]=pre[i-1]+(s[i]=='#');
    m=n-pre[n-1];
    for(i=0;i<n;i++)m=min(m,pre[i]+n-1-i-(pre[n-1]-pre[i]));
    printf("%d\n",m);
    return 0;
}