package main

import (
	"fmt"
)

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

	count := 0
	t := s
	for left := 0; left < n - 1; left++ {
		if t[left: left+1] == "#" && t[left + 1: left + 2] == "." {
			count++
			t = t[:left + 1] + "#" + t[left + 2:]
		}
	}

	min := count
	count = 0
	t = s
	for right := len(s); right > 1; right-- {
		if t[right - 1: right] == "." && t[right - 2: right - 1] == "#" {
			count++
			t = t[:right - 2] + "." + t[right - 1:]
		}
	}

	if min > count {
		min = count
	}
	fmt.Println(min)
}
