<?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++;
    } 
}
if($shape == true &&  $count > 0) {
    $shapeC = substr_count($s, "#");
    $dotC = substr_count($s, ".");
    if($shapeC < $dotC){
        echo $shapeC;
    }else {
        echo $dotC;
    }
}else {
    echo "0";
}
  ?>