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