let num = Int(readLine()!)
let str = readLine()!

var prevs: String = ""
var count: Int = 0
var wcount: Int = 0

for s in str.characters {
    if( ( prevs == "#" ) && ( String(s) == "." ) ) {
      count += 1
      prevs = "#"
    } else {
  	  prevs = String(s)
    }
  
  	if( String(s) == "." ) {
      wcount += 1
    }

}

print( count )