#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() {
    cin.tie(0); ios::sync_with_stdio(false);

    int n;
    cin >> n;

    string s;
    cin >> s;

    vector<int> num_w(n + 1), num_b(n + 1);
    for (int i = 0; i < n; ++i) {
        if (s[i] == '.') ++num_w[i];
        else ++num_b[i];
    }
    for (int i = 1; i < n; ++i) {
        num_w[i] += num_w[i - 1];
        num_b[i] += num_b[i - 1];
    }

    int min_cnt = num_w[n - 1];
    for (int i = 0; i < n; ++i) {
        int num = num_b[i] + (num_w[n - 1] - num_w[i]);
        min_cnt = min(min_cnt, num);
    }

    cout << min_cnt << endl;

    return 0;
}
