program main
  implicit none
  integer ::le,i,j,counter(3)=0
  character(300000) n
  read(*,*)j
  read(*,*)n
  le=len_trim(n)
  do j=1,le
    if(n(j:j)=='#')exit
  enddo
  do i=j,le
    if(n(i:i)=='.')counter(1)=counter(1)+1
  enddo
  do i=j,le
    if(n(i:i)=='.')counter(2)=counter(2)+1
  enddo
  do i=j,le
    if(n(i:i)=='#')counter(3)=counter(3)+1
  enddo
  do i=le,j,-1
    if(n(i:i)=='.')exit
  enddo
  counter(3)=counter(3)+(i-le)
  write(*,*)minval(counter)
end program main
