local n = io.read("*n", "*l")
local str = io.read()
local t = {}
for i = 1, n do
  t[i] = string.sub(str, i, i) == "#" and 1 or 0
end
local blacks, whites = {}, {}
blacks[1] = t[1]
for i = 2, n do
  blacks[i] = blacks[i - 1] + t[i]
end
for i = 1, n do
  whites[i] = i - blacks[i]
end
local ret = n
local btot = blacks[n]
for i = 0, n do
  local cand = 0
  if(i == 0) then
    cand = cand + whites[n]
  else
    cand = cand + blacks[i]
    cand = cand + (whites[n] - whites[i])
  end
  ret = math.min(ret, cand)
end
print(ret)
