<?php
  $N = trim(fgets(STDIN));
  $S = trim(fgets(STDIN));
  $white = 0;
  $black = 0;
 
  for($i = 0; $i < $N; $i++){
    if($S[$i] == "."){
      $white++;
    }else{
      $black++;
    }
  }
 
if($S[$N-1] == "#"){
  $black--;
}
if($S[0] == "."){
  $white--;
}

  if($white > $black){
    echo $black."\n";
  }else{
    echo $white."\n";
  }
 
?>