# abcde -> String
readline_() = readline() |> chomp
# a b c d e -> Array{SubString{String},1}
readline_array_string() = readline() |> chomp |> split
# 1 2 3 4 5 -> Array{Int64, 1}
readline_array_int() = [parse(Int, x) for x in readline() |> chomp |> split]
read_int() = parse(Int, readline() |> chomp)

function main(n, str)
    firstblack = 0
    for (i, s) in enumerate(str)
        if s == '#'
            firstblack = i
            break
        end
    end

    if firstblack == 0
        print(0)
        return
    end
    count = 0
    for i = firstblack:n
        if str[i] == '#'
            count += 1
        end
    end
    m = n - firstblack + 1
    a = m - count
    print(min(a, count))
end

n = read_int()
str = readline_()

main(n, str)