import Data.Array
import Data.List

foldl_trace::(b->a->b)->b->[a]->[b]
foldl_trace f seed []     = []
foldl_trace f seed (x:xs) = (f seed x):(foldl_trace f (f seed x) xs)


sum_trace::[Int]->[Int]
sum_trace ls = 0:(foldl_trace (+) 0 ls)

still_n::[Int]->Array Int Int
still_n ls = listArray (0,length ls) (sum_trace ls)

solver::String->Int
solver dat = let n = length dat in
             let ar = still_n (map (\ c -> if c == '#' then 1 else 0) dat) in
             minimum [ar!(k-1) + (n - (k-1) - (ar!n) + ar!(k-1)) |k<-[1..(n+1)]]

main::IO()
main=do
  _<-getLine
  print.solver=<<getLine