f s n
 |null s=n
 |head s=='.' = f (tail s) n+1
 |otherwise=n+1
g s n
 |null s=n
 |head s=='#' = g (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
     ss=length$filter(=='#')s
     sd=filter(=='#')(take (l-(g (reverse s) 0)) s)
 print$if (ss==l||ss==0) || (ss==1&&last s=='#')then 0 else min sd sl