package main

import (
	"fmt"
)

func strbyind(str string, ind []int) string {
	u := make([]uint8, len(ind))
	for i := range ind {
		u[i] = str[i]
	}
	return string(u)
}

func omit(str string) int {
	count := 0
	l := len(str)
	ind := make([]int, 0)
	i := 0
	for i < l - 1 {
		if str[i:i+1+1] == "#." {
			count += 1
			i += 2
		} else {
			ind = append(ind, i)
			i += 1
		}
	}
	if l >= 2 {
		if str[l-2:l] != "#." {
			ind = append(ind, l)
		}
	}
	if count == 0 {
		return 0
	} else {
		count += omit(strbyind(str, ind))
	}
	return count
}

func main() {
	var n int
	fmt.Scan(&n)
	var str string
	fmt.Scan(&str)
	value := omit(str)
	fmt.Print(value)
}