#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
    int n;
    string s;
    cin >> n >> s;
    int b = 0, w = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '.') w++;
    }
    int ans = w;
    for (int i = 0; i < n; i++) {
        if (s[i] == '#') b++;
        if (s[i] == '.') w--;
        ans = min(ans, w + b);
    }
    cout << ans << endl;
    return 0;
}
