package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	var S string
	fmt.Scan(&S)
	ans := 0
	for i := N - 1; i >= 1; i-- {
		if S[i] == '.' && S[i-1] == '#' {
			ans++
			i-- 
		}
	}
	fmt.Println(ans)
}
