<?php
//error_reporting(0);
$N = trim(fgets(STDIN));
$S = trim(fgets(STDIN));
//list($A,$B,$C) =  explode(" ",trim(fgets(STDIN)));

$p = strpos($S,"#");
if ($p === false) {
  $ret = 0;
}
else {
  $n = substr($S,$p);
  $ret = min(substr_count($n,"."),substr_count($S,"#"));
}
printf("%d\n",$ret);
