 int main() {
   int kuro=0,siro=0,nocount=0,n,i;
   
   
   scanf("%d",&n);
   char s[n];
   scanf("%s",s);
  
   for(i=n-1;i>=0;i--){
     if(s[i]=='#')
     nocount++;
     if(s[i]=='.')
   break;
   }
   
   n=n-nocount;
   
    for(i=0;i<n;i++){
     if(s[i]=='#')
     kuro++;
     if(s[i]=='.')
     siro++;
   }
   
   if (kuro<siro)
    printf("%d",kuro);
   else 
    printf("%d",siro);
   return 0;
 }