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

int main() {
    int N; cin >> N;
    string S1; cin >> S1;
    string S2(S1.c_str(), S1.length());

    int ret1 = 0;
    for(int i = 0; i < N-1; i++) {
        if(S1[i] == '#' && S1[i+1] == '.') {
            S1[i+1] = '#';
            ret1++;
        }
    }
    int ret2 = 0;
    for(int i = N-1; i > 0; i--) {
        if(S2[i] == '.' && S2[i-1] == '#') {
            S2[i-1] = '.';
            ret2++;
        }
    }
    if(S2[0] == '.' && S[1] == '#' ret2++;
//    cout << ret1 << endl;
//    cout << ret2 << endl;
    cout << min(ret1, ret2) << endl;
}