package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n, &s)

	if strings.Count(s, "#") == 0 {
		fmt.Println(0)
		return
	}

	ans := n
	for i := 0; i < n; i++ {
		if v := strings.Count(s[:i], "#") + strings.Count(s[i:], "."); v < ans {
			ans = v
		}
	}
	fmt.Println(ans)
}
