N = gets.to_i
S = gets.chomp

c = 0
b = 0
initial_white = true
N.times do |i|
  if S[i] == '#'
    initial_white = false
    b += 1
  else
    unless initial_white
      c += 1
    end
  end
end

puts [b, c].min