#include <bits/stdc++.h>
using namespace std;
int n,a,b;
string s;
int main(){
    cin>>n>>s;
    for(int i=0;i<n;i++){
        if(s[i] == '.') a++;
        if(s[i] == '#') b++;
    }
    if(b == n){cout<<0<<endl;exit(0);}
    int A = 0,B = 0;
    int mn = 1000000009;
    for(int i=0;i<n;i++){
        if(s[i] == '.') A++;
        if(s[i] == '#') B++;
        mn = min(mn,B+a-A);
    }
    cout<<min(mn,min(a,b))<<endl;
}   