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

//#.# の時は ###におきかえそれ以外は(#..) ...に置き換える
$n1 = substr_count($S,"#.#");
$S = str_replace("#.#","###",$S);
if (substr($S,-2)=="#.") {
  $S[$N-1]="#";
  $n1++;
}
printf("%d\n",substr_count($S,"#.")+$n1);
