package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func rs() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1e6), 1e6)
	n, s := ri(), rs()

	csHash := make([]int, n+1)
	csDot := make([]int, n+1)
	ctHash := 0
	ctDot := 0
	for i, v := range s {
		if v == '#' {
			ctHash++
		} else {
			ctDot++
		}
		csHash[i+1] = ctHash
		csDot[i+1] = ctDot
	}

	minCost := 10000000
	for i := 0; i <= n; i++ {
		costHash := csHash[n-i]
		costDot := csDot[i]
		cost := costHash + costDot
		if cost < minCost {
			minCost = cost
		}
	}
	fmt.Println(minCost)
}
