local n=io.read("n","l")
local s=io.read()

local _,white=s:gsub("%,","")
local black=0
local result=black+white
for i=1,n do
    if s:sub(i,i)=="#" then
        black=black+1
    else
        white=white-1
    end
    result=math.min(result,black+white)
end
print(result)