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

$sum=array(0);
for($i=0;$i<$N;$i++) {
  if ($S[$i]=="#") $wk = 1;
  else $wk = 0;
  $sum[$i+1]=$sum[$i]+$wk;
}
$m = $N;
for($i=0;$i<$N;$i++) {
  $tmp = $sum[$i+1] + getWsum($N-1,$sum)-getWsum($i,$sum);
  //printf("%d black %d white %d\n",$i+1,$sum[$i+1],getWsum($N-1,$sum)-getWsum($i,$sum));
  $m = min($m,$tmp);
}
printf("%d\n",$m);

function getWsum($pos,$sum)
{
  return $pos+1 - $sum[$pos+1];
}
