#include<stdio.h>
int main()
{ 
  int n,i,j,wsum=0,bsum;
  scanf("%d",&n);
  char u[n];
  for(i=0;i<n;i++)
    scanf("%s",&u[i]);
  for(i=0;i<n;i++)
    if(u[i]=='#') break;
  for(j=i+1;j<n;j++)
    if(u[j]=='.') bsum++;
  
  for(i=n-1;i>=0;i--)
    if(u[i]=='.') break;
  for(j=i-1;j>0n;j--)
    if(u[j]=='#') wsum++;
  
  if(wsum<bsum) printf("%d",wsum);
    else printf("%d",bsum);
  return 0;
}