#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
    string s;
    int n;
    cin>>n>>s;
    int count11=0,count12=0,count21=0,count22=0;

    for(int i=0;i<n;i++){
        if(count11==0){
            if(s[i]=='#')count=1;
        }
        else{
            if(s[i]=='.')count21++;
        }
        if(count12==0){
            if(s[i]=='.')count=1;
        }
        else{
            if(s[i]=='#')count22++;
        }
    }
    if(count22>count21)cout<<count21<<endl;
    else cout<<count22<<endl;
}