parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n=parseInt(readline())
    s=chomp(readline())
    res1=0
    flg1=false
    res2=0
    flg2=true
    for i in 1:n
        if s[i]=='.'
            if flg1
                res1+=1
            end
        elseif !flg1
            flg1=true
        end
        if s[i]=='#'
            if flg2
                res2+=1
            end
        elseif !flg2
            flg2=false
        end
    end
    println(min(res1,res2))
end
main()