#include<stdio.h>

main(void)
{
  int num;
  int count=0;
  int change=0;
  char moji[200001];
  
  scanf("%d",&num);
  scanf("%s",moji);
  
  while(count<num)
  {
    if(count>=1)
      {
        if(moji[count]=='.')
        {
          if(moji[count-1]=='#')
          {
            moji[count-1]='.';
            change++;
          }
        }
      }
      count++;
  }
  printf("%d",change);
  
  return 0;
}
