package main

import (
	"fmt"
	"io"
	"os"
)

func solve(w io.Writer, r io.Reader) {
	var N int
	var S string
	fmt.Fscan(r, &N, &S)

	var before_black, after_black, before_white, after_white int
	var found bool
	// #. ###...
	for i := 0; i < len(S); i++ {
		if S[i] == '#' {
			if found {
				after_black++

			} else {
				before_black++
			}
			if i+1 < len(S) && S[i+1] == '.' {
				found = true
				before_black += after_black
				after_black = 0
			}
		} else {
			if found {
				after_white++
			} else {
				before_white++
			}
		}
	}

	var ans int
	if found {
		if after_white < before_black {
			ans = after_white
		} else {
			ans = before_black
		}
	} else {
		ans = 0
	}
	fmt.Fprintln(w, ans)
}

func main() {
	solve(os.Stdout, os.Stdin)
}
