n = readline.to_i
l = readline.chomp.chars
a = b = 0
as = Array.new(n){0}
bs = Array.new(n){0}
(0..l.size).map{|i|
  if l[i] == '.'
    a += 1
  else
    b += 1
  end
  as[i+1] = a
  bs[i+1] = b
}
puts (0..l.size).map{|i|
  (bs[i] - bs[0]) + (as[n] - as[i])
}.min