object Main{
	def main(args:Array[String]){
		val s = new java.util.Scanner(System.in)
		val n = s.nextInt
		val t = s.next
		val b,w = Array.fill(n+2)(0)

		for(i <- 0 to n - 1)
			b(i+1) = b(i) + (if(t.charAt(i) == '#') 1 else 0)
		for(i <- n-1 to 0 by -1)
			w(i+1) = w(i+2) + (if(t.charAt(i) == '.') 1 else 0)


//		println(b.mkString(" "))
//		println(w.mkString(" "))

		println((1 to n).map(i=>b(i)+w(i+1)).min)
	}
}
