package main

import (
	"fmt"
	"math"
)

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

	preBlacked := false
	triggerd := false
	bCnt := 0.0
	wCnt := 0.0

	for _, r := range s {
		if r == '#' {
			if !triggerd {
				bCnt++
			}
			preBlacked = true
		} else {
			if preBlacked || triggerd {
				triggerd = true
				wCnt++
			}
			preBlacked = false
		}
	}

	fmt.Println(math.Min(bCnt, wCnt))
}
