local function str2tbl(s)
    local t = {string.byte(s, 1, #s)}
    for i=1, #t do
        t[i] = string.char(t[i])
    end
    return t
end
--
local N,_,S = io.read("n", "l", "l")
local B = '#'
local W = '.'
S = str2tbl(S)
local tbl = {}
for i=1,N+1 do
    table.insert(tbl, {})
end
local bs = 0
for i=1,N do
    local t = tbl[i]
    t.bs = bs
    if S[i] == B then
        bs = bs + 1
    end
end
tbl[N+1].bs = bs
local ws = 0
tbl[N+1].ws = 0
for i=N,1,-1 do
    local t = tbl[i]
    if S[i] == W then
        ws = ws + 1
    end
    t.ws = ws
end
local ans = N+1
for i=1,N+1 do
    local t = tbl[i]
    ans = math.min(ans, t.bs + t.ws)
end
print(ans)