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, middle_black, after_black, middle_white, after_white int
	found := false
	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] == '.' {
				if found {
					middle_black += after_black
					after_black = 0
					middle_white += after_white
					after_white = 0
				}
				found = true
			}
		} else {
			if found {
				after_white++
			}
		}
	}

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

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