n = gets.to_i
s = gets.chomp.split("")
wb = {0=>0}
white, black = 0,0
flag = 0
for i in s
    if flag == 0 && i == "#"
       black += 1
       flag = 1
    elsif i == "." && flag == 1
       white += 1
       wb[white] = black
    elsif i == "#"
       black += 1
    end
end

#p wb.to_a
puts wb.to_a[-1].min