package main
import "fmt"
func main() {
  var n,x,y int
  var s string
  fmt.Scan(&n)
  fmt.Scan(&s)
  var a []int = make([]int,n)
  var b []int = make([]int,n)
  for i:=0;i<n;i++ {
    if s[i:i+1] == "#" {
      a[i] = 1
      b[i] = 1
    }
  }
  x = 0
  for i:=0;i<n-1;i++ {
    if a[i] == 1 && a[i+1] == 0 {
      a[i+1] = 1
      x++
    }
  }
  y = 0
  for i:=n-1;i>0;i-- {
    if b[i] == 0 && b[i-1] == 1 {
      b[i-1] = 0
      y++
    }
  }
  if x > y { x = y }
  fmt.Println(x)
}