package main

import (
	"fmt"
)

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

	const white, black = '.', '#'
	beforeColor, toBlackCount, toWhiteCount := '.', 0, 0
	for i := 0; i < n; i++ {
		currentColor := int32(s[i])
		if beforeColor == black && currentColor == white {
			toBlackCount++
			currentColor = black
		} else if currentColor == black && i != n - 1 {
			toWhiteCount++
		}
		beforeColor = currentColor
	}

	var result int
	if toBlackCount < toWhiteCount {
		result = toBlackCount
	} else {
		result = toWhiteCount
	}
	fmt.Print(result);
}
