<?php
  
  fscanf(STDIN, "%d", $n);
  fscanf(STDIN, "%s", $s);

  $shape = false;
  $count = 0;
  for ($i=0; $i<$n; $i++) {
    if (substr($s, $i, 1) == "#") {
        $shape = true;
    }
    if (substr($s, $i, 1) == "." && $shape == true) {
        $count++;
    }
}
echo $count;
  ?>