#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,c1=0;
    cin>>n;
    string s;
    cin>>s;
    for(ll i=0;i<n;i++)
    {
        if(s[i]=='.')
            c1++;
    }
    ll black=0;
    ll cnt=c1;
    for(ll i=0;i<n;i++)
    {
        if(s[i]=='#')
            black++;
        else
            c1--;
        cnt = min(cnt,c1+black);
    }
    cout<<cnt<<'\n';
    return 0;
}
