#include<iostream>
using namespace std;

int min_change(int N,string S){
    int kuro=0,shiro=0;

    for(int i=0;i<N;i++){
        if(S[i]=='.') shiro++;
    }
    int m=shiro;
    for(int i=0;i<N;i++){
        if(S[i]=='#') kuro++;
        if(S[i]=='.') shiro--;
        m = min(m,(kuro+shiro));
    }

    return m;
}

int main(){
    int N;
    string S;
    cin >> N >> S;
    cout << min_change(N,S) << endl;
    return 0;
}