import Data.List
f (x:s) k=(if (head x)==k then 0 else length x)+(if null s then 0 else f s k)
main=do
 x<-getLine
 s<-group<$>getLine
 print$(if length s == 1 then 0 else if(head.head)s == '#' then min (f s '#')(f (init s) '.') else min (f(tail s)'#')(f ((tail.init) s)'.'))