 int main() {
   int black=0,white=0,left_lack=0,n,i;
   
   
   scanf("%d",&n);
   char s[n];
   scanf("%s",s);
  
   for(i=0;i<n;i++){
     if(s[i]=='#')
      left_lack++;
     else
     left_lack=0;
   }
   
   n=n-left_lack;
   
    for(i=0;i<n;i++){
     if(s[i]=='#')
     black++;
    else
     white++;
   }
   
   if (black<white)
    printf("%d",black);
   else 
    printf("%d",white);
   return 0;
 }