
n = gets.chomp.to_i
n += 1

s = gets.chomp

boundaries = []
curr = ""

min = 99999


s.chars.each_with_index do |a,i|

  if(a != curr)
    
    boundaries.push(i) if a == "#"
    curr = a
  
  end

end


if (boundaries.length == 0 || boundaries.length == 1)
  
  puts 0
  exit
end


boundaries.each do |j|

  front = s.slice(0, j)
  back = s.slice(j, s.length)
  
  p1 = front.count("#")
  p2 = back.count(".")
  sum = p1 + p2

  min = sum if(min > sum)

end

puts min