#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    string S;
    cin >> N >> S;

    vector<int> shiro(N+1,0);
    int cnt = 0;
    for (int i=1; i<N+1; i++) {
        if (S.at(i-1)=='.') cnt++;
        shiro.at(i)=cnt;
    }

    int ans = N;
    for (int i=0; i<N+1; i++) {
        int now = (i-shiro.at(i))+(shiro.at(N)-shiro.at(i));
        ans = min(now, ans);
    }

    cout << ans << endl;

}