#include <iostream>
#include <string>
using namespace std;

int main() {
    int n;
    int cnt1 = 0; 
    int cnt2 = 0;
    int cnt = 0;
    string s;
    string S;
    cin >> n >> s;
    S = s;

    if (s.end() == '.') {
        for (int i = 0; i < n; i++) {
            if (s[i] == '.') cnt1++;
            else if (s[i] == '#') cnt2++;
        }
        cout << min(cnt1, cnt2) << endl;
    }
    else if (s.end() == '#') {
        for (int i = 0; i < n; i++) {
            if (s[i] == '.') cnt1++;
            else if (s[i] == '#') cnt2++;
        }
        cout << min(cnt1, cnt2-1) << endl;
    }
    return 0;
}