n = gets.to_i
ss = gets.chomp.chars
b = Array.new(n, 0)
w = Array.new(n, 0)
n.times do |i|
  ss[i] == '#' ? b[i] = 1 : w[i] = 1
end
b = b.inject([0]) { |i, j| i << i.last + j }
w = w.unshift(0)
w = w.reverse
w = w.inject([0]) { |i, j| i << i.last + j }
w = w.reverse
ans = []
(n+1).times do |i|
  ans.push(b[i] + w[i])
end
puts ans.min