n = gets.chomp.to_i
s = gets.chomp

left_b = Array.new(n, 0)
right_w = Array.new(n, 0)

left_b[0] = 1 if s[0] == '#'
for i in 1..(n-1)
  if s[i] == '#'
  	left_b[i] = left_b[i-1] + 1
  else
    left_b[i] = left_b[i-1]
  end
end

right_w[n-1] = 1 if s[n-1] == '.'
for i in 1..(n-1)
  if s[n-1-i] == '.'
  	right_w[n-1-i] = right_w[n-i] + 1
  else
    right_w[n-1-i] = right_w[n-i]
  end
end

sum = Array.new(n+1, 0)
sum[0] = right_w[0]
sum[n] = left_b[n-1]
for i in 0..n-2
  sum[i+1] = left_b[i] + right_w[i+1]
end
puts sum.min
