#include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <locale>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

int main() {
    cin.tie(0);
    long n;
    string s;
    cin >> n;
    cin >> s;
    long minsharp = n;
    for (long i = 0; i < n; i++) {
        if (s[i] == '#') {
            minsharp = i;
            break;
        }
    }
    long answ = 0;
    for (long i = minsharp; i < n - 1; i++) {
        if (s[i] == '#') answ++;
    }

    minsharp = n;
    for (long i = 0; i < n; i++) {
        if (s[i] == '#') {
            minsharp = i;
            break;
        }
    }

    test long ansb = 0;
    for (long i = minsharp; i < n; i++) {
        if (s[i] != '#') ansb++;
    }

    cout << min(ansb, answ) << endl;
    // cout << answ << endl;
    return 0;
}