#include <bits/stdc++.h>
using namespace std;

int main(){
    int N, cntw, cntb, start;
    string S;
    cin >> N >> S;
    cntw = cntb = 0;
    ans = 0;
    for(int i = 0; i < N; i++){
        if(S[i] == '#') {
            start = i;
            break;
        }
    }
    for(int i = start; i < N; i++){
        if(S[i] == '#') cntb++;
        else cntw++;
    }
    if(cntb < cntw){
        cout << cntb << endl;
    } else {
        cout << cntw << endl;
    }
    return 0;
}