#include<iostream>
#include <vector>
#include <algorithm>
#include <string>

int main() {
    string S;
    long N;
    cin >>N>> S;
    long count_front = count(S.begin(),S.end(),'#');
    long count_back = count(S.begin(),S.end(),'.');
    if (count_front>count_back){
        cout << count_back << endl;
    } else{
        cout << count_front << endl;
    }
    return 0;

}