length = gets.to_i
str = gets.strip.to_s
reverse = str.reverse

ex_ch = nil

normal_count = 0
str.each_char do |ch|
  if ch == '.' && ex_ch =='#'
    normal_count += 1
    ex_ch = '#'
  else
    ex_ch = ch
  end
end

ex_ch = nil

reverse_count = 0
reverse.each_char do |ch|
  if ch == '#' && ex_ch =='.'
    reverse_count += 1
    ex_ch = '.'
  else
    ex_ch = ch
  end
end


puts normal_count > reverse_count ? reverse_count : normal_count