n = gets.chomp.to_i
s = gets.chomp

w = 0
b = 0
b_count = 0

for i in 1..n do
    if (s[i-1]=='.')
        b += b_count
        b_count = 0
        if (b > 0) 
            w += 1
        end
    elsif (s[i-1]=='#')
        b_count += 1
    end
end

p [w,b].min