f s n
 |null s=n
 |head s=='.' = f (tail s) n+1
 |otherwise=n+1
main=do
 l<-readLn :: IO Int
 s<-getLine
 let sr=f s 0
     sp=take (l-sr)$reverse s
     sl=length$filter(=='.')sp
 print$if sl==l || (length(filter(=='#')s)==1&&last s=='#')then 0 else min length(filter(=='#')s) sl