package main

import (
	"fmt"
)

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

	const white, black = ".", "#"
	before, toBlackCount, towhiteCount := ".", int64(0), int64(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
	}

	var result int64
	if toBlackCount < towhiteCount {
		result = toBlackCount
	} else {
		result = towhiteCount
	}
	fmt.Print(result);
}