package main

import (
	"fmt"
)

func main() {
	var N int
	var S string
	fmt.Scan(&N, &S)
	count := 0
	pastCount := count
	for {

		for i := 0; i < N-1; i++ {
			l := string(S[i])
			r := string(S[i+1])
			if l == "#" && r == "." {
				count++
				S = string(S[:i]) + "." + string(S[i+1:])
			}
		}
		if count == pastCount {
			break
		} else {
			pastCount = count
		}
	}

	fmt.Println(count)
}
