#include <algorithm>
#include <vector>

using namespace std;

int getLastBlackWithoutWhiteIndex(string s) {
    for (int i = s.size() - 1; 0 <= i; --i) {
        if (s[i] == '.') {
            return i;
        }
    }
    return 0;
}

int main() {
    int n;
    string s;
    cin >> n >> s;

    int c = getLastBlackWithoutWhiteIndex(s);
    int b, w;
    for (int i = b = w = 0; i <= c; ++i) {
        if (s[i] == '#') ++b;
        else             ++w;
    }

    cout << min(w, b) << endl;
}
