program main
  implicit none
  integer ::le,i,j,a=0,b=0,am,bm
  character(300000)::n
  read(*,*)j
  read(*,*)n
  le=len_trim(n)
  do i=1,le
    if(n(i:i)=='.')a=a+1
    if(n(i:i)=='#')b=b+1
  enddo
  am=a
  bm=b
  do j=1,le
    if(n(j:j)=='.')then
      a=a-1
      if(am>a)am=a
    else
      a=a+1
    endif
  enddo
  do j=le,1,-1
      if(n(j:j)=='#')then
      b=b-1
      if(bm>b)bm=b
    else
      b=b+1
    endif

  enddo
  write(*,*)min(am,bm)
end program main
