local n = io.read("*n", "*l")
local s = io.read()
local t = {}
for i = 1, n do
  t[i] = s:sub(i, i) == "#" and 1 or 0
end
local sum = {t[1]}
for i = 2, n do
  sum[i] = sum[i - 1] + t[i]
end
local ret = n - sum[n]
for i = 1, n do
  local not_white = sum[i]
  local not_black = (n - i) - (sum[n] - sum[i])
  ret = math.min(ret, not_white + not_black)
end
print(ret)
