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

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

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

if( bcount < wcount ) {
  print( bcount  )
} else {
  print( wcount  )
}