s = gets.to_i
n = gets.chomp.split("")
bw = Array.new(2,0)
ans = 10**6
s.times{|i| bw[0] += 1 if n[i] == "#"}
ans = bw[0]
for i in 1..s
  if n[-i] == "#"
    bw[0] -= 1
  else
    bw[1] += 1
  end
  ans = bw[0]+bw[1] if ans > bw[0]+bw[1]
end
puts ans
