n = gets.to_i
c = ('.' + gets.chomp).chars
left = [0, 0]
right = [c.count(?.), c.count(?#)]
p (n+1).times.map{|i|
  if c[i] == ?.
    left[0] += 1
    right[0] -= 1
  else
    left[1] += 1
    right[1] -= 1
  end
  left[1] + right[0]
}.min
