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

$p = strpos($S,"#");
//最後の白以降の黒
$lp = strrpos($S,".");
if ($p === false) {
  $ret = 0;
}
else {
  $n = substr($S,$p);
  //最初の黒以降の白を全部置き換えるか、
  $n2 = substr($S,0,$lp+1);
  //黒を白に置き換えるか(最後の白以降の黒は置き換えなくていい)
  $ret = min(substr_count($n,"."),substr_count($n2,"#"));
}
printf("%d\n",$ret);
