 int main() {
   int ablack=0,black=0;
  int  white=0,rwhite=0,rblack=0,sum=0,n,i;
   
   scanf("%d",&n);
   char s[n];
   scanf("%s",s);
  
   for(i=0;i<n;i++){
  if(s[i]=='.')rwhite++;
     if(s[i]=='#'){rwhite=0;ablack;}
   }
   n=n-rwhite;
       for(i=0;i<n;i++){
  if(s[i]=='.')rblack=0;
     if(s[i]=='#')rblack++;
   } 
     
   n=n-rblack;
   
    for(i=0;i<n;i++){
  if(s[i]=='.')white++;
     if(s[i]=='#')black++;
   }

   if(rblack>rwhite)
    sum=rwhite;
   else
     sum=rblack;
   
   if(black<white)
     sum=sum+black;
   else
     sum=sum+white;
   printf("%d",sum);
   return 0;
 }