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

int main(){
    int N;
    int black[200002] = {};
    int n_black = 0;
    string S;
    cin >> N >> S;

    for(int i=1;i<=N;i++){
        black[i] = black[i-1];
        if(S[i-1] == '#') black[i]++;
    }
    n_black = black[N];

    int ans = 2e5 + 1;
    for(int i=0;i<=N;i++){
        ans = min(ans, black[i] + (N-i) - (n_black - black[i]));
    }
    cout << ans << endl;
    return 0;
}