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