package main

import (
  "fmt"
)

func min(a, b int) int {
  if a < b {
    return a
  }
  return b
}

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

  b := make([]int, n + 1)
  w := make([]int, n + 1)
  for i := 0; i < n; i++ {
    w[i + 1] = w[i]
    b[i + 1] = b[i]
    if s[i] == '.' {
      w[i + 1]++
    } else {
      b[i + 1]++
    }
  }
  ans := n
  for i := 0; i < n; i++ {
    ans = min(ans, b[i + 1] + (w[n] - w[i + 1]))
  }
  fmt.Println(ans)
}
