n = gets.chomp.to_i
s = gets.chomp
countb = 0
countw = 0
countm = 0
abs = 0
pos = n - 1

while pos >= 0
  if s[pos] == '.' then
    break
  end
  pos -= 1
end

while pos >= 0
  if s[pos] == '.' then
    countm += 1
    countw += 1
  else
    countb += 1
  end

  if countm < countb then
    abs += countw
    countb = 0
    countw = 0
    countm = 0
  end
  pos -= 1
end

puts abs + [countw, countb].min
