#include<iostream>
#include<vector>
#include<algorithm>
#include<string>

using namespace std;

int main(){
    int N;
    string S;
    cin >> N;
    cin >> S;
    int count_white, count_black, count_bw = 0;
    // all white
    for(int i = 0; i < N; i++){
        if(S.at(i) == '#') count_white++;
    }
    for(int i = 0; i < N; i++){
        if(S.at(i) == '.') count_black++;
    }
    for(int i = 0; i < count_white; i++){
        if(S.at(i) == '#') count_bw++;
    }
    for (int i = count_white; i < N; i++){
        if(S.at(i) == '.') count_bw++;
    }

    cout << min(count_white, count_bw, count_black) << endl;
}