import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt
  val s = in.readLine.toArray
  val rs = s.reverse
  var cnt1 = 0
  var cnt2 = 0
  var cnt3 = 0
  var k = 0

  for(i <- 0 until n-1) {
    if(s(i)=='#' && s(i+1) == '.'){
      cnt1 += 1
      s(i+1) = '#'
    }
    if(rs(i) == '.' && rs(i+1) == '#' && i != n-2){
      cnt2 += 1
      rs(i+1) = '.'
    }
    if(k == 0 && rs(i) == '#') {
      k = i
    }
  }

  val ans = cnt1 min cnt2
  println(ans)
}