N=gets.to_i
S=gets.chomp
# ....
# ####
# ..##
rets=[0,0,0]
flg=false
(0..(S.length-1)).each do |i|
    if S[i] == "#"
        rets[0]+=1
        flg=true
    else
        rets[1]+=1
        rets[2]+=1 if flg 
    end
end
puts rets.min
