package main

import "fmt"

func main() {
	var n int
	var line string
	fmt.Scan(&n, &line)
	flg, count1, count2 := false, 0, 0
	for _, l := range line {
		s := string(l)
		if !flg && s == "#" {
			flg = true
		}
		if s == "." && flg {
			count1++
		}
		if s == "#" && flg {
			count2++
		}
	}
	if count1 > count2 {
		fmt.Println(count2)
	} else {
		fmt.Println(count1)
	}
}