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

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