#include<stdio.h>
int main(void){
    int i,n,cnt=0;
    char stone[20000000];
    scanf("%d"&n);
    scanf("%s",stone);
    for(i=0;i<n;i++){
        if(stone[i]=='#'&&stone[i+1]=='.'){
            stone[i+1]='#';
            cnt+=1;
        }
    }
    printf("%d",cnt);
    return 0;
    
}