object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val S = in.tail.head.toArray
  val first = S.indexWhere(_=='#')
  val count = S.count(_=='.')
  var ret = if(first == -1) 0 else count - first
  println(ret)
}
