<?php
  
  fscanf(STDIN, "%d", $n);
  fscanf(STDIN, "%s", $s);
 
    $shapeC = substr_count($s, "#");
    $dotC = substr_count($s, ".");

    if($shapeC < $dotC){
        echo $shapeC;
    }else {
        echo $dotC;
    }

  ?>