#include <bits/stdc++.h>
using namespace std;
 
int main(void){
    int N;
    string S;
    cin>>N;
    cin>>S;
    int blaL = 0;
    int whiR = 0;
    for(int i = 0; i<N; i++){
        if(S[i]=='.'){
          whiR++;
        }
    }
    int ans = delR;
    for(int i = 0; i<N; i++){
        if(S[i]=='.'){
            whiR--;
        }else{
            blaL++;
        }
        ans = min(ans,whiR+blaL);
    }
    cout<<ans<<endl;
    return 0;
}