object Main{
	def main(args:Array[String]){
		val s = new java.util.Scanner(System.in)
		s.nextInt
		val v = s.next
		println(math.min(
			v.replaceFirst("^\\.*","").toCharArray.count('.' ==),
			v.replaceFirst("#*$","").toCharArray.count('#' ==)
		))
	}
}