n = STDIN.gets.chomp.to_i
s = STDIN.gets.chomp.split("")

cnt = 0
b = false
s.each{|c| 
  if c == "#"
    b = true
    next
  end
  if b == true && c == "."
    cnt += 1
  end
  }

puts [cnt, n-cnt].min
