program main
 implicit none

 integer N,M,i,j,k
 character*200000 Str
 read(*,*) N, Str
 j = 0
 do i=1,N
  if(Str(i:i) == '#') then
   M = i+1
   j=1
   exit
  end if
 end do

 if(j == 1) then
  k = 0
  do i=M,N
   if(Str(i:i) == '.') then
    k = k+1
   else
    j = j+1
   end if
  end do
  if(k == 0)
   write(*,*) 0
  else
   write(*,*) min(j,k)
  end if
 else
  write(*,*) 0
 end if

end program main