n = gets.to_i
s = gets.chomp.split("")
blf = -1
wlf = n
cntw = 0
cntb = 0
for i in 0..(n-1)
  if s[i] == "#"
    cntb += 1
    blf = i
  end
  if blf != -1
    if s[i] == "."
      cntw += 1
    end
  end
end
puts [cntw, cntb].min