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

int main(){
    int n, i, c = 0, r = 9999999;
    string s;
    cin >> n >> s;
    int cb[n] = {}, cw[n] = {};
    for(i=0; i<n; i++){
        if(s[i] == '.'){
            c++;
        }
        cw[i] = c;
    }
    c = 0;
    for(i=n-1; i>=0; i--){
        if(s[i] == '#'){
            c++;
        }
        cb[i] = c;
    }
    for(i=0; i<n; i++){
        if(i == 0){
            r = min(c, cb[i]);
        }else if(i == n){
            r = min(c, cw[n-1]);
        }else{
            r = min(c, cb[i]+cw[i-1]);
        }
    }
    cout << r;
    return 0;
}