integer N
character(2*10**5) S
integer(16) a,b,i
integer(16) cnt
read*,N,S
a=index(S,"#")
b=index(S,".",.true.)
cnt=0
if(a<b)then
  do i=a,b-1
    if(S(i:i)=="#")cnt=cnt+1
  end do
  cnt=min(cnt,b-a-cnt+1)
endif
print"(I0)",cnt
end