n = gets.to_i
s = gets.chomp.chars
_s = s.reverse
cnt_b = cnt_w = 0
(0..n-1).each do|i|
  if s[i] =="#" && s[i+1] == "."
    cnt_w += 1
    s[i+1] = "#"
  end
end

(0..n-1).each do|i|
  if _s[i] =="." && _s[i+1] == "#"
    cnt_b += 1
    _s[i+1] = "."
  end
end
puts [cnt_w,cnt_b].min
