#include <bits/stdc++.h>
using namespace std;
long long n;
void solve()
{
    string a;
    cin>>a;
    long long i,ans1=0,l=a.length();
    for (i=l-1;i>=0;i--)
        if (a[i]!='#') break;
    l=i;
    for (i=0;i<=l;i++)
        if (a[i]=='.') ans1++;
    cout<<min(ans1,a.length()-ans1)<<endl;
}
int main()
{
    while(cin>>n)
        solve();
    return 0;
}