#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    string s;
    cin >> n >> s;
    int firstblack = 0, lastwhite = n;
    for(int i = 0; i < n; i++) if(s[i] == '#') {
        firstblack = i;
        break;
    }
    for(int i = n - 1; i >= 0; i--) if(s[i] == '.') {
        lastwhite = i;
        break;
    }
    int lans = 0, rans = 0;
    for(int i = firstblack + 1; i < n; i++)
        lans += (s[i] == '.');
    for(int i = lastwhite - 1; i >= 0; i--)
        rans += (s[i] == '#')
    cout << min(lans, rans) << endl;
}
