package main

import (
	"fmt"
	"math"
	"strings"
)

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

	blackStoneCount := strings.Count(s, "#")
	whiteStoneCount := strings.Count(s, ".")
	answer := int(math.Min(float64(blackStoneCount), float64(whiteStoneCount)))
	
  	fmt.Println(answer)
}
