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