package main

import (
	"fmt"
)

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

	count := 0
	for i := n - 1; i > 0; i-- {
		if s[i] == '.' {
			if s[i-1] == '#' {
				count++
			}
		}
	}
	fmt.Println(count)
}
