f(x:s)=if null(tail s) then 0 else if x=='#' || (head s)=='#' then min(g s '.')(g s '#') else f s
g(x:s)k=(if x==k then 0 else 1)+(if null s then 0 else g s k)
main=do
 x<-getLine
 s<-getLine
 print$f s