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

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

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

puts [countw, countb].min
