# 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 omit(str)
    count = 0
    l = length(str)
    ind = Int[]
    for i = 1:l-1
        if str[i:i+1] == "#."
            count += 1
        else
            push!(ind, i)
        end
    end
    if !isempty(ind)
        count += omit(str[ind])
    end
    return count
end

n = read_int()
str = readline_()
value = omit(str)
print(value)