#include <stdio.h>

int main(){

      int i,j,a=0,b=0,N;
      scanf("%d",&N);

      char stone[N];

      scanf("%s",stone);
      
      }
      for(i=0;stone[i] != '\0';i++){
            if(stone[i] =='#' && stone[i+1] == '.'){
                  for(j=i;stone[j] != '\0';j++){
                        a++;
                        if(stone[j+1] == '.'){
                              b++;
                              break;
                        }
                  }
            }
      }
      
      }
      for(i=N;i >= 0;i--){
            if(stone[i] =='.' && stone[i-1] == '#'){
                  for(j=i;j>=0;j--){
                        b++;
                        if(stone[j-1] == '#'){
                              b++;
                              break;
                        }
                  }
            }
      }
      if(a < b){
            printf("%d",a);
     }else{
            printf("%d",b);
      }
}
