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

int main(){
    int n,ans = 2000000;
    string s;
    cin >> n >> s;
    vector<int> b(n + 1,0),w(n + 1,0);
    for(int i = 1;i <= n;i++){
        if(s[i - 1] == '#')b[i]++;
        else w[i]++;
        b[i] += b[i - 1];
        w[i] += w[i - 1];
    }
    for(int i = 0;i <= n;i++){
        ans = min(ans,b[i] + (w[n] - w[i]));
    }
    cout << ans << endl;
}
