N=gets.to_i
S=gets.chomp

dot_from_back=[0]
old=0
S.reverse.each_char do |c|
    if c=="."
        old+=1
    end
    dot_from_back << old
end
dot_from_back << old
dot_from_for=dot_from_back.reverse

sharp_from_for=[0]
old=0
S.each_char do |c|
    if c=="#"
        old+=1
    end
    sharp_from_for << old
end

sharp_from_for << old


min=Float::INFINITY
(S.length+1).times do |i|
    temp=sharp_from_for[i]+dot_from_for[i+1]
    min=temp if temp<min
end


puts min