package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func readLine(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, 2*10^5)
	sc.Buffer(buf, 2*10^5+1024)
	sc.Split(bufio.ScanWords)
	length, _ := strconv.Atoi(readLine(sc))
	str := readLine(sc)
	slice := strings.Split(str, "")

	var count int
	result := length
	for i := 0; i < length; i++ {
		for j := 0; j < length; j++ {
			if j <= i && slice[j] == "#" {
				count++
			} else if j > i && slice[j] == "." {
				count++
			}
		}
		fmt.Println(count)
		if result > count {
			result = count
		}
		count = 0
	}
	fmt.Println(result)
}
