n = gets.chomp.to_i
s = gets.chomp
w = 0
b = 0
n.times do |i|
  if s[i] == "#"
    b += 1
  else
    w += 1
  end
end

bk = w
if s[0] == "."
  bk -= 1
end

wt = b
if s[n-1] == "#"
  wt -= 1
end

puts [bk, wt].min
