package main

import (
	"fmt"
)

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

	const white, black = ".", "#"
	before := "."
	toBlackCount := 0
	towhiteCount := 0
	for i, value := range s {
		str := string(value)
		
		if before == black && str == white {
			toBlackCount++
			str = black
		} else if str == black && i != n - 1 {
			towhiteCount++
		}
		before = str
	}

	result := 0
	if toBlackCount < towhiteCount {
		result = toBlackCount
	} else {
		result = towhiteCount
	}
	fmt.Print(result);
}