#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
    int min(int a, int b);
    int n,i;
    int dot_r = -1,sharp_r = -1;
    int dot_n_r=0,sharp_n_r=0;
    int dot_n_l=0,sharp_n_l=0;
    int ans_r;
    char *s;

    scanf("%d", &n);
    s = malloc(sizeof(char)*(n+1));
    scanf("%s", s);

    for(i=n-1;i>=0;i--){
        if(s[i] == '#'){
            sharp_r = i;
            break;
        }else{
            dot_n_r++;
        }
    }
    if(sharp_r == -1){  //全部白
        printf("0\n");
        return 0;
    }

    for(i=sharp_r;i>=0;i--){
        if(s[i] == '.'){
            dot_r = i;
            break;
        }else{
            sharp_n_r++;
        }
    }

    }
    //右側処理ここまで
    for(i=0;i<=dot_r;i++){
        if(s[i] == '.'){
            dot_n_l++;
        }else if(s[i] == '#'){
            sharp_n_l++;
        }
    }
    printf("%d\n",min(dot_n_l, sharp_n_l)+min(dot_n_r, sharp_n_r));


    return 0;

}

int min(int a, int b){
    if(a<b){
        return a;
    }else{
        return b;
    }
}