program main
  implicit none
  integer ::le,i,j,counter=0,counter1=0,counter2=0,k
  character(100000) n
  read(*,*)j
  read(*,*)n
  le=len_trim(n)
  do k=1,le-1
     if(n(k:k)=='#')exit
  enddo
  do i=k,le-1
     if(n(i:i)=='#' .and. n(i+1:i+1)=='.')counter=counter+1
     if(n(i:i)=='#')counter1=counter1+1
     if(n(i:i)=='.')counter2=counter2+1
  enddo
  write(*,*)min(counter,counter1,counter2)
end program main
