#include<bits/stdc++.h>

using namespace std;

int n, ans, w[1000000], b[1000000];
char s[1000000];

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