#include <stdio.h>
#include <stdlib.h>

int main(void) {
   
   int N;
   
   scanf("%d",&N);
   
   char *S = malloc(sizeof(char)*(N+100));
   
   scanf("%s",S);
   
   int i;
   int flag = 0;
   int count1 = 0;
   
   for(i = 0;i < N;i++){
      if(flag == 1){
         if(S[i] == '.'){
            count1++;
         }
      }
      else {
         if(S[i] == '#'){
            flag = 1;
         }
      }
   }
   
   int count2 = 0;
   
   for(i = 0;i < N;i++){
      if(S[i] == '#'){
         count2++;
      }
   }
   
   if(count1 < count2) {
      printf("%d\n",count1);
   }
   else {
      printf("%d\n",count2);
   }
      
   return 0;
}
