import Data.List
main=do
 l<-readLn :: IO Int
 sr<-getLine
 let sr=map(\x->if head x=='.' then (length x,0) else (length x,1))(group sr)
     sl=length sr
     sp=[(take x sr,drop x sr)|x<-[0..sl]]
 print$minimum$map(\x->sum(map(\s->sum(map(\(a,b)->if b==0 then 0 else a)s))(fst x))+sum(map(\s->sum(map(\(a,b)->if b==1 then 0 else a)s))(snd x)))sp