#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<map>

typedef long long ll;
const int INF=1e9;
using namespace std;

int main(){
    int n;
    cin >> n;
    char s[n];
    int cnt1[n]={};
    int cnt2[n]={};
    for(int i=0;i<n;i++){
        cin >> s[i];
        if(s[i]=='#') cnt1[i]++;
        if(s[i]=='.') cnt2[i]++;
    }
    for(int i=1;i<n;i++){
        cnt1[i]+=cnt1[i-1];
        cnt2[i]+=cnt2[i-1];
    }
    int ans=INF;
    int res;
    for(int i=0;i<n;i++){
        res=cnt1[i]+(cnt2[n-1]-cnt2[i]);
        ans=min(res,ans);
    }
    cout << ans << endl;
}