package main

import (
	"fmt"
	"strings"
)

func Solve(s string) int {
	a := strings.Count(s, "#")
	b := strings.Count(s, ".")
	var c byte
	var d byte
	if a < b {
		c = '.'
		d = '#'
	} else {
		c = '#'
		d = '.'
	}
	var n int
	arr := []byte(s)
	for i := 0; i < len(arr); i++ {
		if j := i + 1; arr[i] == c && j < len(arr) && arr[j] == d {
			arr[j] = c
			n++
		}
	}
	return n
}

func main() {
	var n int
	fmt.Scanf("%d", &n)
	var s string
	fmt.Scanf("%s", &s)
	result := Solve(s)
	fmt.Println(result)
}
