package main
 
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
 
var (
	BufferSize = 2*10*10*10*10*10 + 10
)
 
func scanStr(sc *bufio.Scanner) string {
	if !sc.Scan() {
		panic(nil)
	}
	return sc.Text()
}

func scanInt(sc *bufio.Scanner) int {
	if !sc.Scan() {
		panic(nil)
	}
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	} 
	return i
}
 
func main() {
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, BufferSize)
	sc.Buffer(buf, BufferSize)
	sc.Split(bufio.ScanWords)

	length := scanInt(sc)
	str := scanStr(sc)

	black := make([]int, length)
	white := make([]int, length)

	// 累積和のslice作る
	if str[0] == '.' {
		black[0] = 0
		white[0] = 1
	} else {
		black[0] = 1
		white[0] = 0
	}
	for i := 1; i < length; i++ {
		if str[i] == '.' {
			white[i] = white[i-1] + 1
			black[i] = black[i-1]
		} else {
			white[i] = white[i-1]
			black[i] = black[i-1] + 1
		}
	}

	// 累積和から最小値求める
	var tmp int
	ans := length
	for i := 0; i < length; i++ {
		tmp = black[i] + white[length-1] - white[i]
		if tmp < ans {
			ans = tmp
		}
	}
	fmt.Println(ans)
}