PROGRAM ATCODER

implicit none
integer :: n,count=0,i,ans
character(len=2*10**5) ::  s

read*, n,s

!! 全部黒にした時
do i = 1, n, 1
  if ( s(i:i) == '.' ) then
    count = count + 1
  end if
end do

ans = count

!! 左から1〜i個目までを白にする
do i = 1, n, 1
  if ( s(i:i) == '#' ) then
    count = count + 1
  else
    count = count - 1
  end if
  call chmin(ans,count)
end do

print'(i0)', ans


contains
  
  subroutine chmin(dp,x)
  implicit none
  integer :: dp, x

  if (dp > x) then
  	dp = x
  	return
  end if
  
  end subroutine


END PROGRAM ATCODER