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

using namespace std;
int main(void){
    int N;
    string S;
    cin >> N >> S;
    int cnt1 = 0;
    int cnt2 = 0;
    int now = 1;
    int flag1 = 0;
    int flag2 = 0;
    if(S[0] == '.'){
        flag1 = 1;
        now = 0;
    }
    for(int i = 0; i < N; i++){
        if(S[i] == '#'){
            cnt2 += 1;
        }
        if(now == 1){
            if(S[i] == '.' and flag1 != 1){
                cnt += 1;
                flag2 = 1;
                now = 1 - now;
            }
        }else{
            if(S[i] == '#'){
                now = 1 - now;
                flag2 = 0;
            }else{
                if(flag2 == 1){
                   cnt += 1; 
                }
            }
        }
    }
    int result = max(cnt1, cnt2);
    cout << result << endl;
    return 0;
}